[Ecls-list] Problem with descendants of STANDARD-CLASS

Dan Debertin airboss at nodewarrior.org
Sun Feb 12 21:58:01 UTC 2006


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 ()
()
(:metaclass test-metaclass))
#<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))
  (call-next-method)
  (std-class-allocate-slots class)  ; error here, see below
  (std-class-generate-accessors class))

;; 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.



More information about the ecl-devel mailing list