I had absolutely no idea about the existence of EIEIO.
Why isn't this an XEmacs package? Or even better, why isn't it
distributed as a *standard* part of the distribution?
Eric (Ludlam): Please read what Jan has to say below. If there is any
change to the C code of XEmacs that would make EIEIO work significantly
better, faster, or more reliably, I can guarantee that it will go into the
XEmacs core. Even if you are not familiar with the C core, let me know
generally what you are looking for and I can design it.
ben
Jan Vroonhof wrote:
Eric Marsden <emarsden(a)mail.dotcom.fr> writes:
[Yet another message marked for "Rereading when there is a non-zero
amount of free time]
> EIEIO is at <
URL:http://www.ultranet.com/~zappo/eieio.shtml> (with
> stuff like this I occasionally manage to forget I'm programming in a
> crummy imitation of a Lisp :-).
Now that we have your attention. I have been wanting to look into this
for some time, but still haven't come around to it. Are there any
bottlenecks or imperfections with EIEIO that could be solved with a
little help from the C core?
For instance I am thinking of
opaque-cons (car cdr)
Internal function. Like cons, but the return value is an opaque type
and will signal an error unless passed to opaque-*
opaque-car (ocons)
opaque-cdr (ocons)
opaque-to-cons (ocons)
opaque-cons-p (ocons)
Then you would have in usertype.el
(defun deftype (type operations)
(put type 'type-operations operations)
(define-function
(make-symbol (cons "make-" (symbol-name type))) '(value)
`(opaque-cons ,type value))
(define-function
(make-symbol (cons (symbol-name type))) "-value" '(t)
`((let ((c (opaque-to-cons t)))
(if (eq (car c) ,type)
(cdr c)
(error 'type-error "....")))))
(define-function
(make-symbol (cons (symbol-name type))) "-p" '(t)
`(and (opaque-cons-p t) (eq (opaque-car t) ,type))))
etc
Jan