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

Re: with-slots and specialized

In article <...> andre_koehorst@riks.nl ("Andre Koehorst") writes:
 > REGARDING with-slots and specialized setf's 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.

CLtL2, p. 861:

 ... The macro with-accessors invokes the appropriate accessors to
     access the specified slots.

CLtL2, p. 863:

 ... The macro with-slots translates an appearance of the slot name as a
     variable into a call to slot-value.

Since with-slots uses slot value rather than the accessor to gain access
to the slot, the accessor function is never called.  That is also why
the before and after methods aren't called.

Thomas A. Russ,  USC/Information Sciences Institute          tar@isi.edu    
4676 Admiralty Way, Marina del Rey, CA 90292          (310) 822-1511x775