X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefstruct.lisp;h=aac8f2dc22761554f0d9b3b930c98983fc8f3677;hb=2c06e3056fe6aa820817a927fa0e840eb7b8edb7;hp=c7575501eb4c9738b069e552d44effd455bd26b5;hpb=96bb2dc76dddb1a21b3886fa7522796879e9ed9d;p=sbcl.git diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index c757550..aac8f2d 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -310,6 +310,11 @@ :accessor-name '%raw-instance-ref/complex-long :init-vop 'sb!vm::raw-instance-init/complex-long :n-words #!+x86 6 #!+sparc 8))))) +(defun raw-slot-words (type) + (let ((rsd (find type *raw-slot-data-list* :key #'raw-slot-data-raw-type))) + (if rsd + (raw-slot-data-n-words rsd) + (error "Invalid raw slot type: ~S" type)))) ;;;; the legendary DEFSTRUCT macro itself (both CL:DEFSTRUCT and its ;;;; close personal friend SB!XC:DEFSTRUCT) @@ -1516,10 +1521,14 @@ (loop for slot in (dd-slots defstruct) for name = (dsd-name slot) collect (cond ((find name (skipped-vars) :test #'string=) + ;; CLHS 3.4.6 Boa Lambda Lists (setf (dsd-safe-p slot) nil) '.do-not-initialize-slot.) ((or (find (dsd-name slot) (vars) :test #'string=) - (dsd-default slot))))))))) + (let ((type (dsd-type slot))) + (if (eq t type) + (dsd-default slot) + `(the ,type ,(dsd-default slot)))))))))))) ;;; Grovel the constructor options, and decide what constructors (if ;;; any) to create.