makunbound when +unbound-slot+ is passed to default setter for slot attributes
authorClinton Ebadi <clinton@unknownlamer.org>
Mon, 30 Aug 2010 20:57:49 +0000 (16:57 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Mon, 30 Aug 2010 20:57:49 +0000 (16:57 -0400)
* Any custom setters on a CLOS slot will need to implement this behavior

src/standard-descriptions/clos.lisp

index 377380d..f1465a1 100644 (file)
@@ -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))