X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefstruct.lisp;h=455969729b2bb476bf0917712c52084f466eea68;hb=7e24349c17298e2959e853ea411b5f65d9f7f332;hp=84d841879900969447317f9204bc88053a5a5041;hpb=b1a4f6376799a402903e75d111ef29bdc25e0582;p=sbcl.git diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index 84d8418..4559697 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