[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Understanding the "let" construct and the setting of variables
From: |
Joost Kremers |
Subject: |
Re: Understanding the "let" construct and the setting of variables |
Date: |
Thu, 17 Dec 2020 08:58:39 +0100 |
User-agent: |
mu4e 1.5.7; emacs 27.1.50 |
On Thu, Dec 17 2020, steve-humphreys@gmx.com wrote:
> I ran the following
>
> ELISP> tima
> (lett 845 80)
> "tim_out: 1005"
>
> ELISP> tim
> *** Eval error *** Symbol’s value as variable is void: tim
>
> ELISP> (lett 845 90)
> "tim_out: 1015"
>
> ELISP> tim
> *** Eval error *** Symbol’s value as variable is void: tim
>
> So this is quite different from using "setq". The variable "tim" is
> not available to all of emacs.
Yes, indeed. Variables bound with `let` or `let*` only exist inside the `let`.
So as soon as you put the closing parenthesis matching the opening parenthesis
directly before the `let`, the variables go out of scope and no longer exist.
(There are actually a couple of subtleties involved that make this statement
less than universally true, but those issues shouldn't concern a beginner.)
--
Joost Kremers
Life has its moments
- Re: Understanding the "let" construct and the setting of variables, (continued)
- Re: Understanding the "let" construct and the setting of variables, Joost Kremers, 2020/12/17
- Re: Understanding the "let" construct and the setting of variables, Joost Kremers, 2020/12/17
- Re: Understanding the "let" construct and the setting of variables, steve-humphreys, 2020/12/17
- Re: Understanding the "let" construct and the setting of variables, Joost Kremers, 2020/12/17
- Re: Understanding the "let" construct and the setting of variables, Emanuel Berg, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Emanuel Berg, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Jean Louis, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, tomas, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Emanuel Berg, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, steve-humphreys, 2020/12/16
- Re: Understanding the "let" construct and the setting of variables,
Joost Kremers <=
- RE: Understanding the "let" construct and the setting of variables, Drew Adams, 2020/12/17
- Re: RE: Understanding the "let" construct and the setting of variables, steve-humphreys, 2020/12/17
- RE: RE: Understanding the "let" construct and the setting of variables, Drew Adams, 2020/12/17
- Re: Understanding the "let" construct and the setting of variables, Michael Heerdegen, 2020/12/17
- Re: Understanding the "let" construct and the setting of variables, tomas, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Michael Heerdegen, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Emanuel Berg, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Michael Heerdegen, 2020/12/18
- RE: Understanding the "let" construct and the setting of variables, Drew Adams, 2020/12/18
- Re: Understanding the "let" construct and the setting of variables, Stefan Monnier, 2020/12/19