1.0.20.23: get rid of IGNORE-ERRORS in SB-INTROSPECT
[sbcl.git] / src / code / defstruct.lisp
index c757550..aac8f2d 100644 (file)
                            :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))))
 \f
 ;;;; the legendary DEFSTRUCT macro itself (both CL:DEFSTRUCT and its
 ;;;; close personal friend SB!XC:DEFSTRUCT)
                (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.