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