From: Clinton Ebadi Date: Mon, 30 Aug 2010 20:57:49 +0000 (-0400) Subject: makunbound when +unbound-slot+ is passed to default setter for slot attributes X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/commitdiff_plain/c5cd7a181a2c1204b736ceb0bfebd1a2f55e61f4 makunbound when +unbound-slot+ is passed to default setter for slot attributes * Any custom setters on a CLOS slot will need to implement this behavior --- diff --git a/src/standard-descriptions/clos.lisp b/src/standard-descriptions/clos.lisp index 377380d..f1465a1 100644 --- a/src/standard-descriptions/clos.lisp +++ b/src/standard-descriptions/clos.lisp @@ -49,7 +49,9 @@ (unless (attribute-setter object) (setf (attribute-setter object) (lambda (v o) - (setf (slot-value o (attribute-slot-name object)) v))))))) + (if (unbound-slot-value-p v) + (slot-makunbound o (attribute-slot-name object)) + (setf (slot-value o (attribute-slot-name object)) v)))))))) (define-layered-method attribute-value-using-object (object (attribute slot-definition-attribute))