* bug fix: the logic for getting names of functions gets less
confused when confronded with alternate-metaclass
funcallable-instances. (reported by Cyrus Harmon)
+ * bug fix: FUNCTIONP and (LAMBDA (X) (TYPEP X 'FUNCTION)) are now
+ consistent, even on internal alternate-metaclass objects.
* threads
** bug fix: parent thread now can be gc'ed even with a live
child thread
;;; !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.
+ ;; 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)
(find-layout 'instance))))
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 'instance)))
+ (funcallable-structure
+ (aver (eq superclass-name 'funcallable-instance)))
+ (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)))
(!defstruct-with-alternate-metaclass ctor
:slot-names (function-name class-name class initargs)
:boa-constructor %make-ctor
- :superclass-name pcl-funcallable-instance
+ :superclass-name funcallable-instance
:metaclass-name random-pcl-classoid
:metaclass-constructor make-random-pcl-classoid
:dd-type funcallable-structure
(load "assertoid.lisp")
(use-package "ASSERTOID")
+(use-package "TEST-UTIL")
(defmacro assert-nil-nil (expr)
`(assert (equal '(nil nil) (multiple-value-list ,expr))))
(assert-t-t (subtypep `(not ,t2) `(not ,t1)))
(assert-nil-t (subtypep `(not ,t1) `(not ,t2))))
\f
+;;; not easily visible to user code, but this used to be very
+;;; confusing.
+(with-test (:name (:ctor :typep-function))
+ (assert (eval '(typep (sb-pcl::ensure-ctor
+ (list 'sb-pcl::ctor (gensym)) nil nil)
+ 'function))))
+(with-test (:name (:ctor :functionp))
+ (assert (functionp (sb-pcl::ensure-ctor
+ (list 'sb-pcl::ctor (gensym)) nil nil))))
+\f
;;; success