[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Aug 19 19:21:01 1999 
Subject:Re: Stack manipulation syntax (WAS: A primeval C compiler) 
From:Lieven Marchand 
Volume-ID:990819.03 

Chris Dollin <kers@hplb.hpl.hp.com> writes:

> Lieven Marchand wrote:
> > 
> > richard@starburst.demon.co.uk (Richard Wendland) writes:
> > 
> > > Nice.  Updater functions are another nice feature I've not come across
> > > in another language.
> > 
> > Common Lisp SETF expander functions
> > 
> > It's indeed a nice feature.
> 
> It may be a nice feature; it *isn't* the same feature. 
> 

You're right. I hadn't consider uses like yours. 

> The difference is that in Common Lisp you have to write a setf-expander for
> each updater name, ie this is essentially a compile-time activity. It's
> much harder (if possible at all; my Steele is at home) to write the
> equivalent of
> 
>     define exhibit( f, x ); 42 -> f(x) enddefine;
> 
> where the updater is determined dynamically. This matters more in Pop,

I suppose the system does something like get-updater(f, x)(42)
internally where it accesses the updater function from the object key?
It's been nearly ten years since I've seriously looked at pop-11.

> of course, because so many more things (eg vectors, arrays, properties)
> are either functions or contrive to look like them. My own code passes
> properties as parameters all over the place; it would be gobsmackingly
> awful if I had to define umpteen setf forms to access them by the many
> different names I call those parameters!

It can be done without that by passing results of get-setf-expansion
and hiding that with some macrology but it would become ugly very
soon.

-- 
Lieven Marchand <mal@bewoner.dma.be>
If there are aliens, they play Go. -- Lasker