"%LOG1P"
#!+long-float "%LONG-FLOAT"
"%MAKE-COMPLEX" "%MAKE-FUNCALLABLE-INSTANCE"
+ "%MAKE-FUNCALLABLE-STRUCTURE-INSTANCE-ALLOCATOR"
"%MAKE-RATIO" "%MAKE-LISP-OBJ"
"%MAKE-INSTANCE"
"%MAKE-STRUCTURE-INSTANCE"
,@slot-vars))))))
(declaim (ftype (sfunction (defstruct-description list) function)
- %Make-structure-instance-allocator))
+ %make-structure-instance-allocator))
(defun %make-structure-instance-allocator (dd slot-specs)
(let ((vars (make-gensym-list (length slot-specs))))
(values (compile nil `(lambda (,@vars)
(%make-structure-instance-macro ,dd ',slot-specs ,@vars))))))
+(defun %make-funcallable-structure-instance-allocator (dd slot-specs)
+ (when slot-specs
+ (bug "funcallable-structure-instance allocation with slots unimplemented"))
+ (let ((name (dd-name dd))
+ (length (dd-length dd))
+ (nobject (gensym "OBJECT")))
+ (values
+ (compile nil `(lambda ()
+ (let ((,nobject (%make-funcallable-instance ,length)))
+ (setf (%funcallable-instance-layout ,nobject)
+ (%delayed-get-compiler-layout ,name))
+ ,nobject))))))
+
;;; Delay looking for compiler-layout until the constructor is being
;;; compiled, since it doesn't exist until after the EVAL-WHEN
;;; (COMPILE) stuff is compiled. (Or, in the oddball case when
(eval-when (:compile-toplevel :load-toplevel :execute)
(%compiler-set-up-layout ',dd ',(inherits-for-structure dd))))))
+(sb!xc:proclaim '(special *defstruct-hooks*))
+
(sb!xc:defmacro !defstruct-with-alternate-metaclass
(class-name &key
(slot-names (missing-arg))
;; code, which knows how to generate inline type tests
;; for the whole CMU CL INSTANCE menagerie.
`(defun ,predicate (,object-gensym)
- (typep ,object-gensym ',class-name)))))))
+ (typep ,object-gensym ',class-name)))
+
+ (when (boundp '*defstruct-hooks*)
+ (dolist (fun *defstruct-hooks*)
+ (funcall fun (find-classoid ',(dd-name dd)))))))))
\f
;;;; finalizing bootstrapping
(defclass condition-class (slot-class) ())
(defclass structure-class (slot-class)
- ((defstruct-form
- :initform ()
- :accessor class-defstruct-form)
- (defstruct-constructor
- :initform nil
- :accessor class-defstruct-constructor)
- (from-defclass-p
- :initform nil
- :initarg :from-defclass-p)))
+ ((defstruct-form :initform () :accessor class-defstruct-form)
+ (defstruct-constructor :initform nil :accessor class-defstruct-constructor)
+ (from-defclass-p :initform nil :initarg :from-defclass-p)))
(defclass definition-source-mixin (standard-object)
((source
(!fix-early-generic-functions)
(!fix-ensure-accessor-specializers)
(compute-standard-slot-locations)
-(dolist (s '(condition structure-object))
+(dolist (s '(condition function structure-object))
(dohash ((k v) (classoid-subclasses (find-classoid s)))
(find-class (classoid-name k))))
(setq *boot-state* 'complete)
(defun print-std-instance (instance stream depth)
(declare (ignore depth))
(print-object instance stream))
-
(defun make-defstruct-allocation-function (name)
;; FIXME: Why don't we go class->layout->info == dd
(let ((dd (find-defstruct-description name)))
- (%make-structure-instance-allocator dd nil)))
+ (ecase (dd-type dd)
+ (structure
+ (%make-structure-instance-allocator dd nil))
+ (funcallable-structure
+ (%make-funcallable-structure-instance-allocator dd nil)))))
(defmethod shared-initialize :after
((class structure-class) slot-names &key
(with-test (:name (:ctor :functionp))
(assert (functionp (sb-pcl::ensure-ctor
(list 'sb-pcl::ctor (gensym)) nil nil nil))))
+;;; some new (2008-10-03) ways of going wrong...
+(with-test (:name (:ctor-allocate-instance :typep-function))
+ (assert (eval '(typep (allocate-instance (find-class 'sb-pcl::ctor))
+ 'function))))
+(with-test (:name (:ctor-allocate-instance :functionp))
+ (assert (functionp (allocate-instance (find-class 'sb-pcl::ctor)))))
\f
;;; from PFD ansi-tests
(let ((t1 '(cons (cons (cons (real -744833699 -744833699) cons)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.21"
+"1.0.21.1"