X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefstruct.lisp;h=338c09a991ce59d85dc801d306260a0120465093;hb=975f1932acc3a8e90fb31d2b055bfbdde78ea927;hp=995a12fefe30546a039395e2106879a0f4a098e4;hpb=d1e7b48b17180a417c41ed55eb382ebf6d4e7a2a;p=sbcl.git diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index 995a12f..338c09a 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -933,9 +933,14 @@ ;;; Return a LAMBDA form which can be used to set a slot. (defun slot-setter-lambda-form (dd dsd) - `(lambda (new-value instance) - ,(funcall (nth-value 1 (slot-accessor-transforms dd dsd)) - '(dummy new-value instance)))) + ;; KLUDGE: Evaluating the results of SLOT-ACCESSOR-TRANSFORMS needs + ;; a lexenv. + (let ((sb!c:*lexenv* (if (boundp 'sb!c:*lexenv*) + sb!c:*lexenv* + (sb!c::make-null-lexenv)))) + `(lambda (new-value instance) + ,(funcall (nth-value 1 (slot-accessor-transforms dd dsd)) + '(dummy new-value instance))))) ;;; core compile-time setup of any class with a LAYOUT, used even by ;;; !DEFSTRUCT-WITH-ALTERNATE-METACLASS weirdosities @@ -1029,6 +1034,7 @@ (let* ((accessor-name (dsd-accessor-name dsd)) (dsd-type (dsd-type dsd))) (when accessor-name + (setf (info :function :structure-accessor accessor-name) dd) (let ((inherited (accessor-inherited-data accessor-name dd))) (cond ((not inherited) @@ -1579,7 +1585,7 @@ metaclass-constructor)) (declare (type symbol predicate)) (declare (type (member structure funcallable-structure) dd-type)) - (declare (ignore boa-constructor predicate runtime-type-checks)) + (declare (ignore boa-constructor predicate runtime-type-checks-p)) (let* ((dd (make-dd-with-alternate-metaclass :class-name class-name @@ -1725,4 +1731,12 @@ (inherits (inherits-for-structure dd))) (%compiler-defstruct dd inherits))) +;;; finding these beasts +(defun find-defstruct-description (name &optional (errorp t)) + (let ((info (layout-info (classoid-layout (find-classoid name errorp))))) + (if (defstruct-description-p info) + info + (when errorp + (error "No DEFSTRUCT-DESCRIPTION for ~S." name))))) + (/show0 "code/defstruct.lisp end of file")