I'm trying out MOP features on various Lisps lately. Here's the problem I'm
having with ECL:
ECL (Embeddable Common-Lisp) 0.9h
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. Top level.
(defclass test-metaclass (standard-class)
#<The STANDARD-CLASS TEST-METACLASS>
;; So far, so good. Now let's define a class using the new metaclass:
(defclass my-test ()
#<The TEST-METACLASS MY-TEST> is not of type SEQUENCE.
Broken at LAMBDA.
I traced this through the depths of CLOS (whew, does kernel.lsp get hairy :-),
and followed it down to this:
;; src/clos/standard.lsp: line 236, method FINALIZE-INHERITANCE
(defmethod finalize-inheritance ((class standard-class))
(std-class-allocate-slots class) ; error here, see below
;; src/clos/standard.lsp: line 377, function STD-CLASS-ALLOCATE-SLOTS
(setf (class-shared-slots class)
(make-array (1+ shared-index) :initial-element (unbound))
(slot-index-table class) table))) ; error here
It looks like classes using STANDARD-CLASS as the metaclass get a slot called
SLOT-INDEX-TABLE, but classes using other metaclasses, including descendants of
STANDARD-CLASS (in my case, MY-TEST), do not.
From the looks of kernel.lsp, STANDARD-CLASS is a bit of a different animal from
other classes, but it would be nice if whatever special treatment it gets from
CLOS could be extended to its descendants.
Is this a bug? Is anyone working on it, or should I dig into it?
Actually, if it's generally known that MOP on ECL is not well-implemented or
doesn't work, a simple "no, go away" will suffice ;-).