X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefstruct.lisp;h=40f7ba91fdaaf1870f9b8ae582dba45cf5701ac6;hb=2c6b90e36a7c0377cd79625eb6c94d580f98cb93;hp=c48bc580c6557088c178892e6f8caeec6e330046;hpb=cbaa1997bb097a55d108df592ac3b7eb4a703fff;p=sbcl.git diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index c48bc58..40f7ba9 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -85,7 +85,7 @@ ;; classes, CLASS-STRUCTURE-P = NIL) ;; ;; vector element type - (element-type 't) + (element-type t) ;; T if :NAMED was explicitly specified, NIL otherwise (named nil :type boolean) ;; any INITIAL-OFFSET option on this direct type @@ -165,8 +165,8 @@ ;;;; the legendary DEFSTRUCT macro itself (both CL:DEFSTRUCT and its ;;;; close personal friend SB!XC:DEFSTRUCT) -;;; Return a list of forms to install print and make-load-form funs, mentioning -;;; them in the expansion so that they can be compiled. +;;; Return a list of forms to install PRINT and MAKE-LOAD-FORM funs, +;;; mentioning them in the expansion so that they can be compiled. (defun class-method-definitions (defstruct) (let ((name (dd-name defstruct))) `((locally @@ -199,7 +199,7 @@ (funcall #',(farg po) ,x ,s)))) (t nil)))) ,@(let ((pure (dd-pure defstruct))) - (cond ((eq pure 't) + (cond ((eq pure t) `((setf (layout-pure (class-layout (sb!xc:find-class ',name))) t))) @@ -210,9 +210,7 @@ ,@(let ((def-con (dd-default-constructor defstruct))) (when (and def-con (not (dd-alternate-metaclass defstruct))) `((setf (structure-class-constructor (sb!xc:find-class ',name)) - #',def-con)))) - ;; FIXME: MAKE-LOAD-FORM is supposed to be handled here, too. - )))) + #',def-con)))))))) ;;; FIXME: I really would like to make structure accessors less special, ;;; just ordinary inline functions. (Or perhaps inline functions with special ;;; compact implementations of their expansions, to avoid bloating the system.) @@ -493,7 +491,7 @@ (cond ((eq type 'funcallable-structure) (setf (dd-type defstruct) type)) ((member type '(list vector)) - (setf (dd-element-type defstruct) 't) + (setf (dd-element-type defstruct) t) (setf (dd-type defstruct) type)) ((and (consp type) (eq (first type) 'vector)) (destructuring-bind (vector vtype) type @@ -516,7 +514,7 @@ (eval-when (:compile-toplevel :load-toplevel :execute) (defun parse-name-and-options (name-and-options) (destructuring-bind (name &rest options) name-and-options - (assert name) ; A null name doesn't seem to make sense here. + (aver name) ; A null name doesn't seem to make sense here. (let ((defstruct (make-defstruct-description name))) (dolist (option options) (cond ((consp option) @@ -621,7 +619,7 @@ (setf (dsd-default islot) default)) (when type-p (setf (dsd-type islot) - (if (eq (dsd-type islot) 't) + (if (eq (dsd-type islot) t) type `(and ,(dsd-type islot) ,type)))) (when ro-p @@ -1168,7 +1166,7 @@ (t (dsd-index slot))) (cond - ((eq rtype 't) object) + ((eq rtype t) object) (data) (t `(truly-the (simple-array (unsigned-byte 32) (*)) @@ -1269,8 +1267,7 @@ (dolist (slot (dd-slots defstruct)) (let ((dum (gensym)) (name (dsd-name slot))) - (arglist `((,(intern (string name) "KEYWORD") ,dum) - ,(dsd-default slot))) + (arglist `((,(keywordicate name) ,dum) ,(dsd-default slot))) (types (dsd-type slot)) (vals dum))) (funcall creator