;;; !DEFSTRUCT-WITH-ALTERNATE-METACLASS weirdosities
(defun %compiler-set-up-layout (dd
&optional
- ;; Several special cases (STRUCTURE-OBJECT
- ;; itself, and structures with alternate
- ;; metaclasses) call this function directly,
- ;; and they're all at the base of the
- ;; instance class structure, so this is
- ;; a handy default.
- (inherits (vector (find-layout t)
- (find-layout 'instance))))
+ ;; Several special cases
+ ;; (STRUCTURE-OBJECT itself, and
+ ;; structures with alternate
+ ;; metaclasses) call this function
+ ;; directly, and they're all at the
+ ;; base of the instance class
+ ;; structure, so this is a handy
+ ;; default. (But note
+ ;; FUNCALLABLE-STRUCTUREs need
+ ;; assistance here)
+ (inherits (vector (find-layout t))))
(multiple-value-bind (classoid layout old-layout)
(multiple-value-bind (clayout clayout-p)
reversed-result)
(incf index))
(nreverse reversed-result))))
+ (case dd-type
+ ;; We don't support inheritance of alternate metaclass stuff,
+ ;; and it's not a general-purpose facility, so sanity check our
+ ;; own code.
+ (structure
+ (aver (eq superclass-name 't)))
+ (funcallable-structure
+ (aver (eq superclass-name 'function)))
+ (t (bug "Unknown DD-TYPE in ALTERNATE-METACLASS: ~S" dd-type)))
(setf (dd-alternate-metaclass dd) (list superclass-name
metaclass-name
metaclass-constructor)
`(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
- (%compiler-set-up-layout ',dd))
+ (%compiler-set-up-layout ',dd ',(inherits-for-structure dd)))
;; slot readers and writers
(declaim (inline ,@(mapcar #'dsd-accessor-name dd-slots)))
;; Note: This has an ALTERNATE-METACLASS only because of blind
;; clueless imitation of the CMU CL code -- dunno if or why it's
;; needed. -- WHN
- (dd-alternate-metaclass dd) '(instance)
+ (dd-alternate-metaclass dd) '(t)
(dd-slots dd) nil
(dd-length dd) 1
(dd-type dd) 'structure)