X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Flow.lisp;h=2a333d0d68cf47d25edd1401a40f89002d8b467d;hb=f17e3d27d7ff599f9443d011d17017a2a858c81a;hp=db01419a98e9375f57ea69f4dbbbb62c62a919b4;hpb=838316d0ad9affb2a4284ece65798aed6313d7e7;p=sbcl.git diff --git a/src/pcl/low.lisp b/src/pcl/low.lisp index db01419..2a333d0 100644 --- a/src/pcl/low.lisp +++ b/src/pcl/low.lisp @@ -351,6 +351,12 @@ comparison.") (member (dsd-name included-slot) slot-overrides :test #'eq)) collect slot))))) +(defun uninitialized-accessor-function (type slotd) + (lambda (&rest args) + (declare (ignore args)) + (error "~:(~A~) function~@[ for ~S ~] not yet initialized." + type slotd))) + (defun structure-slotd-name (slotd) (dsd-name slotd)) @@ -358,13 +364,19 @@ comparison.") (dsd-accessor-name slotd)) (defun structure-slotd-reader-function (slotd) - (fdefinition (dsd-accessor-name slotd))) + (let ((name (dsd-accessor-name slotd))) + (if (fboundp name) + (fdefinition name) + (uninitialized-accessor-function :reader slotd)))) (defun structure-slotd-writer-function (type slotd) (if (dsd-read-only slotd) (let ((dd (find-defstruct-description type))) (coerce (slot-setter-lambda-form dd slotd) 'function)) - (fdefinition `(setf ,(dsd-accessor-name slotd))))) + (let ((name `(setf ,(dsd-accessor-name slotd)))) + (if (fboundp name) + (fdefinition name) + (uninitialized-accessor-function :writer slotd))))) (defun structure-slotd-type (slotd) (dsd-type slotd))