[plt-scheme] Question about fluid-let

From: David T. Pierson (dtp at mindstory.com)
Date: Mon Jan 2 21:07:51 EST 2006

On Fri, Dec 30, 2005 at 10:02:07AM -0800, Greg Woodhouse wrote:
> (define bump-counter
>   (lambda ()
>      (set! counter (+ counter 1))
>      counter))

> by let in the second example, so bump-counter affects the binding in
> effect when it was defined, not when it is used. Is this what is
> referred to as a closure?


> Anyway, I wonder if fluid-let doesn't actually introdeuce what I'd call
> a dynamic scope in Perl, Python or MUMPS (meaning the binding is
> accessed via a dynamic link), or am I on the wrong track?

"binding" can be a confusing term because it seems that sometimes people
use it to mean the tie between a variable and a value, while other times
it means the tie between an identifier and a memory location.

fluid-let can be used to simulate dynamic scoping, but the memory
location referred to by the identifier is always statically determined.

(Hopefully someone will correct me if I've got this wrong.)


Posted on the users mailing list.