guile-devel
[Top][All Lists]
Advanced

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

Re: Bug in eval-string?


From: Matthias Koeppe
Subject: Re: Bug in eval-string?
Date: Fri, 09 Aug 2002 12:24:12 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.80 (sparc-sun-solaris2.7)

Marius Vollmer <address@hidden> writes:

> Matthias Koeppe <address@hidden> writes:
>
>> Marius Vollmer <address@hidden> writes:
>> 
>> > What about adding "with" as a general dynamic scoping construct?
>> >
>> >   (with ((current-module) boxx)
>> >      ...)
>> 
>> Please don't.
>> 
>> AFAIK, dynamic-scoping hacks of this flavor are commonly known as
>> FLUID-LET in Scheme:
>
> But "with" is such a nice name compared to "fluid-let"! ;) 

The name is *too nice* for something like FLUID-LET.  Remember, it
uses DYNAMIC-WIND and lots of SET!s.  It is inefficient if CALL/CC is
used.  It won't work in a threaded environment.

BTW, FLUID-LET was the topic of a now-withdrawn SRFI, see
http://srfi.schemers.org/srfi-15/srfi-15.html

> I forgot one level of parenthesis in the code above, it was supposed
> to work for multiple bindings.
>
> I'd say that fluid-let should be in the core. Opinions?

I'd say, we should rather make SLIB integration smoother, and/or
provide a SRFI-15 implementation (despite its withdrawn status).  

Putting it in the core won't be a good idea IMHO.

 1)  It creates confusion because Guile knows real fluid variables.
     FLUID-LET has "fluid" in its name but has no connection to
     fluids.

 2)  WITH-FLUIDS is much cleaner than FLUID-LET.  People should use
     WITH-FLUIDS if they want (threadsafe) dynamic scoping.

Moreover, for the application of switching modules by "dynamically
binding" the place (CURRENT-MODULE), I think that using either your
originally proposed "WITH" syntax or the FLUID-LET syntax are bad
ideas because they suggest simple variable assignments, whereas
changing the current module is a much heavier thing.

Regards,

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]