help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: local binding, too local...


From: Jean-Christophe Helary
Subject: Re: local binding, too local...
Date: Sat, 8 Dec 2018 23:45:32 +0900

Thank you Tomas.

So can you say that "binding" is like "creating" a variable ?
While assigning is just putting a value in that variable ?

I remember in my math classes, when we were using x and y, etc. we were binding 
x and y, right ? And then when we had values for x and y we were assigning 
values. Is that correct ?

Jean-Christophe 

> On Dec 8, 2018, at 17:02, <tomas@tuxteam.de> <tomas@tuxteam.de> wrote:
> 
> On Sat, Dec 08, 2018 at 04:37:59PM +0900, Jean-Christophe Helary wrote:
> 
> [...]
> 
>> I'm not sure I understand the difference yet between binding and assigning 
>> yet.
> 
> Binding: you associate a name (strictly: a symbol) to a place where to
> store something (a "variable").
> 
> Assigning: you change the content (the thing stored in) an existing variable.
> 
> Often you get those two steps in one package, and that's why the difference
> isn't so clear.
> 
> Consider:
> 
> 
>  (let ((foo 12)) ; bind a variable to the symbol foo
>    ...
>    (... ; some sub-scope, e.g. another let
>         ; let's assume it does *not* bind foo
>      (setq foo 13) ; Now the foo is bound to the same variable,
>                    ; but that contains now 13
>    ))
> 
> Things are a bit confusing, because (let ((foo 12)) ...) binds foo *and*
> assigns 12. But you could just use (let (foo) ...) in its pure form
> 
> Cheers
> -- t

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune




reply via email to

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