[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: with-slots and specialized



Excerpts from internet.listserv.info-mcl: 11-Nov-93 with-slots and
specialized  by "Andre Koehorst"@riks.nl 
> If  the value of a slot is set from within a call to with-slots, before and
> after methods on setf are ignored. This is not the case when the call is from
> within with-accessors. 
> This is very counter-intuitive. But is it a bug? CLtL didn't help me
very much.
> 

I believe this behaviour is correct.  When you define the before method,
you are defining a setf method for the accessor of the slot-value
test-slot, not the test-slot slot-value itself.  You may be confused
because you named the slot and the accessor the same thing.  With-slots
gives you direct access to the slot, so that the "accessor" is only
implicitly called once.  With-accessors, on the other hand, uses the
accessor everywhere the macro variable appears.

Blaine.