[pro] When to use SLOT-VALUE...

Scott McKay swm at itasoftware.com
Thu Dec 2 21:50:12 UTC 2010


The system that Dan and I are working on does, in fact,
have a 'with-accessors' macro that does just what you think.

On Dec 2, 2010, at 12:37 PM, Ben Hyde wrote:

> On Dec 1, 2010, at 9:51 AM, Daniel Weinreb wrote:
>> The methods called by the callers (1) expect to find the object in a
>> consistent state, and (2) must leave the object in a consistent state
>> when they terminate, whether they terminate normally (return) or
>> abruptly (signal, return, throw, etc.)
>> 
>> It is possible that there are :before or :after methods on the reader
>> or writer.  In fact, it's even possible that the primary method was
>> overridden, if this is a subclass.  These methods must also keep the
>> object in a consistent state.
> 
> I find it curious, my reaction to that.   In part it is warm and  
> nostalgic, as there was a time when I was more enthusiastic about  
> designing in that mind set.  I am less so now.  I now tend to open  
> module boundaries.  I'm much less shy about revealing  
> implementations.  I find it more pliable.   And I tighten things down  
> in that kind of righteous way only if the code manages to survive long  
> enough to get the honor of maintenance and a large cliental.
> 
> Anyhow.  Recall that with-slots expands to slot-value.  That leads me  
> to wonder.   Given that with-slots and slot-value are couple, why  
> haven't I observed analogous couple (with-fields and field-value say)   
> for accessors.
> 
>  - ben
> 
> _______________________________________________
> pro mailing list
> pro at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/pro





More information about the pro mailing list