[CM] scoping in scheme

Orm Finnendahl finnendahl@folkwang-hochschule.de
Thu, 30 Oct 2003 08:52:42 +0100

Am 29. Oktober 2003, 16:59 Uhr (-0500) schrieb Michael Klingbeil:
> You can get this effect in Scheme using fluid-let (if your 
> implementation of Scheme supports fluid-let, or if you define it 
> yourself)

thanks, syntaxwise that was exactly what i was looking for.

> Not sure what Scheme you are using.


> Anyway the mechanism of fluid-let essentially creates a temporary 
> binding for the toplevel value of i. So it  does not actually create 
> a new lexical variable. Instead it assigns the desired value to the 
> current lexical value, and then it restores the old value upon 
> exiting from the body of the fluid-let.

...and allocates temporary storage space for the old meaning of the
lexical variable. At first sight it looks a little awkward to actually
access the toplevel variable, rather than persuade a procedure to
access a local binding, but I'll give it a try as in my case it will
probably speed up computation significantly.