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

From: Andre Mayers (Andre.Mayers at USherbrooke.ca)
Date: Sun Sep 15 18:34:34 EDT 2013

Thank you for your answer. But it is still not clear. 

> (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

The two binding [x => 'uuu] and [x =>'a] are exactly in the same lexical
space (the second binding is not in a lexical subspace) and that doesn't
make sense for me. As far as I know, to shadow a binding, you have to create
a lexical subspace. Am I wrong ? 



-----Message d'origine-----
De : Jon Zeppieri [mailto:zeppieri at gmail.com] 
Envoyé : 15 septembre 2013 11:20
À : Andre Mayers
Cc : users at lists.racket-lang.org
Objet : Re: [racket] Why is x can be simultenaously bind and not bind ?

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.