[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] dynamic scoping
From: |
Kon Lovett |
Subject: |
Re: [Chicken-users] dynamic scoping |
Date: |
Wed, 26 Jun 2013 15:21:30 -0700 |
Sadly, John Cowan's fine table of SRFI support by implementation doesn't cover
SRFI 15.
In practice real dynamic variables - parameters - are the way to go for library
or other distributed code. & they are in R7RS!
On Jun 26, 2013, at 3:01 PM, Dan Leslie <address@hidden> wrote:
> Oh you just had to be different. ;)
>
> The related SRFI is withdrawn, is it safe to assume that fluid-let will be
> available outside of Chicken?
>
> -Dan
>
> On 6/26/2013 2:56 PM, Kon Lovett wrote:
>> See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let
>>
>> #;1> (define a 1)
>> #;2> (define (add x) (+ x a) )
>> #;3> (let ((a 100) ) (add 10) )
>> 11
>> #;4> (fluid-let ((a 100) ) (add 10) )
>> 110
>>
>>
>> On Jun 26, 2013, at 2:47 PM, "Daniel Ajoy" <address@hidden> wrote:
>>
>>> "add" binds a to 1 at the moment of definition.
>>>
>>> #;48> (define a 1)
>>> #;49> (define (add x) (+ x a) )
>>> #;50> (add 10)
>>> 11
>>> #;51> (let ((a 100) ) (add 10) )
>>> 11
>>>
>>> Is there a way to give a different value of "a" to add, so that, something
>>> like this happens:
>>>
>>> (let ((a 100) ) (add 10) )
>>> 110
>>>
>>> Daniel
>>>
>>> _______________________________________________
>>> Chicken-users mailing list
>>> address@hidden
>>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>>
>> _______________________________________________
>> Chicken-users mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>