[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
signature.asc
Description: Digital signature
- local binding, too local..., Jean-Christophe Helary, 2018/12/07
- RE: local binding, too local..., Drew Adams, 2018/12/08
- Re: local binding, too local..., Yuri Khan, 2018/12/08
- Re: local binding, too local..., Jean-Christophe Helary, 2018/12/08
- Re: local binding, too local...,
tomas <=
- Re: local binding, too local..., Jean-Christophe Helary, 2018/12/08
- Re: local binding, too local..., tomas, 2018/12/08
- Re: local binding, too local..., Jean-Christophe Helary, 2018/12/08
- Re: local binding, too local..., tomas, 2018/12/09
- Re: local binding, too local..., Jean-Christophe Helary, 2018/12/09
Message not available