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: tomas
Subject: Re: local binding, too local...
Date: Sat, 8 Dec 2018 09:02:17 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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