[racket] Why is x can be simultenaously bind and not bind ?

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Sun Sep 15 11:20:29 EDT 2013

On Sun, Sep 15, 2013 at 9:26 AM, Andre Mayers
<Andre.Mayers at usherbrooke.ca> wrote:
> Another way to ask the question is why is it possible to execute
> (let ([x 'uuu])
>   (set! x 'a)
>   x)
>

This:
1. creates a binding [x => 'uuu]
2. changes that same binding to [x => 'a]
3. gives the value of that binding

> and
>
> (let ([x 'uuu])
>   (define x 'a)
>   x)

This:
1. creates a binding [x => 'uuu]
2. creates a different binding [x => 'a] that shadows the existing binding of x
3. gives the value of the *visible* binding of x, namely 'a

Posted on the users mailing list.