X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fctor.lisp;h=31fc178e16f22674ac67a3550498725866ee84df;hb=4ba392170e98744f0ef0b8e08a5d42b988f1d0c9;hp=4237d1cfab89d0cb76b1dcb3d2b1837be1e2ca61;hpb=503ad9d8685b335a69dc667dec4ce48f1a03af98;p=sbcl.git diff --git a/src/pcl/ctor.lisp b/src/pcl/ctor.lisp index 4237d1c..31fc178 100644 --- a/src/pcl/ctor.lisp +++ b/src/pcl/ctor.lisp @@ -152,7 +152,21 @@ (ctor-function-name ctor)))) (defun make-ctor-function-name (class-name initargs safe-code-p) - (list* 'ctor class-name safe-code-p initargs)) + (labels ((arg-name (x) + (typecase x + ;; this list of types might look arbitrary but it is + ;; exactly the set of types descended into by EQUAL, + ;; which is the predicate used by globaldb to test for + ;; name equality. + (list (gensym "LIST-INITARG-")) + (string (gensym "STRING-INITARG-")) + (bit-vector (gensym "BIT-VECTOR-INITARG-")) + (pathname (gensym "PATHNAME-INITARG-")) + (t x))) + (munge (list) + (let ((*gensym-counter* 0)) + (mapcar #'arg-name list)))) + (list* 'ctor class-name safe-code-p (munge initargs)))) ;;; Keep this a separate function for testing. (defun ensure-ctor (function-name class-name initargs safe-code-p) @@ -590,7 +604,7 @@ (declare (ignore ii-methods si-methods)) (let ((class (ctor-class ctor)) (lambda-list (make-ctor-parameter-list ctor)) - (initargs (quote-plist-keys (ctor-initargs ctor)))) + (initargs (ctor-initargs ctor))) (if use-make-instance `(lambda ,lambda-list (declare #.*optimize-speed*) @@ -598,13 +612,13 @@ ;; *COMPILING-OPTIMIZED-CONSTRUCTOR* which is bound around ;; compilation of the constructor, hence avoiding the ;; possibility of endless recursion. - (make-instance ,class ,@initargs)) + (make-instance ,class ,@(quote-plist-keys initargs))) (let ((defaults (class-default-initargs class))) (when defaults (setf initargs (ctor-default-initargs initargs defaults))) `(lambda ,lambda-list (declare #.*optimize-speed*) - (fast-make-instance ,class ,@initargs)))))) + (fast-make-instance ,class ,@(quote-plist-keys initargs))))))) ;;; Not as good as the real optimizing generator, but faster than going ;;; via MAKE-INSTANCE: 1 GF call less, and no need to check initargs. @@ -870,8 +884,8 @@ ,value-form)))) (not-boundp-form () (if (member slotd sbuc-slots :test #'eq) - `(slot-boundp-using-class - ,class .instance. ,slotd) + `(not (slot-boundp-using-class + ,class .instance. ,slotd)) `(eq (clos-slots-ref .slots. ,i) +slot-unbound+)))) (ecase kind