Hi Hans,
On Sat 06 Mar 2010 10:03, Hans Aberg <[email protected]> writes:
> (define add1 (lambda (y) (+ x y)))
> and then
> (define add (lambda (x) ...))
> Thus in two separate steps, where the unbound symbol x in the first
> expression is bound only in the second.
If I understand you correctly, this is not possible in normal Scheme. (I
say normal Scheme because you can build your own interpreter for another
kind of Scheme within Guile, one with dynamic binding, say.)
The way to leave a bound identifier unbound is precisely to wrap it in a
closure. For example to "delay binding" of Y and Z in:
(lambda (x) (+ x y z))
you need wrap the expression in a lambda:
(lambda (y z)
(lambda (x) (+ x y z)))
Which seems to be what you're trying to get away from, though I don't
know why.
Hope this helps,
Andy
--
http://wingolog.org/