[cells-devel] Re: not-to-be and owning slots

Peter Hildebrandt peter.hildebrandt at gmail.com
Mon Apr 21 08:54:38 UTC 2008


On Mon, Apr 21, 2008 at 10:38 AM, Peter Hildebrandt
<peter.hildebrandt at gmail.com> wrote:
>  As a proof of concept, I changed not-to-be to be

There's something weird going on, i.e. it is not called reliably on
the kids slot.  The follwoing works better:

(defmethod not-to-be :before ((fm family))
  (let ((sv-kids (slot-value fm '.kids)))
    (when (listp sv-kids)
      (dolist ( kid sv-kids)
	(not-to-be kid))))
  (bwhen (ownings (get (type-of fm) :ownings)  )
    (loop for (slot . nil) in ownings
       do (unless (eql slot '.kids)
	    (bwhen (owned (slot-value fm slot))
	      (if (listp owned)
		  (mapc #'not-to-be owned)
		  (not-to-be owned)))))))

>  It used to be:
>
>  (defmethod not-to-be :before ((fm family))
>   (let ((sv-kids (slot-value fm '.kids)))
>     (when (listp sv-kids)
>       (dolist ( kid sv-kids)
>         (not-to-be kid))))
>
>  I haven't committed it yet, because I'd like to hear your opinion,
>  especially on what this might break :-)
>
>  Peter
>



More information about the cells-devel mailing list