chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] dynamic scoping


From: Dan Leslie
Subject: Re: [Chicken-users] dynamic scoping
Date: Wed, 26 Jun 2013 14:52:57 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

By using parameters; see also:

http://api.call-cc.org/doc/chicken/parameters/make-parameter
http://api.call-cc.org/doc/miscmacros/define-parameter
http://api.call-cc.org/doc/chicken/special-forms/parameterize

-Dan

On 6/26/2013 2:47 PM, Daniel Ajoy 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




reply via email to

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