emacs-devel
[Top][All Lists]
Advanced

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

Re: PATCH: Explicitly show how let works on global-variables


From: Pedro Andres Aranda Gutierrez
Subject: Re: PATCH: Explicitly show how let works on global-variables
Date: Tue, 4 Oct 2022 10:09:38 +0200

Hi Eli,

may be. But in my case it didn't. I was misled by the term 'local variable' coming from (and using) other programming languages.

As I understood the text (and to continue with the system-time-locale) I understood as local variable a 'value that was stored in the function's stack' to be used in the scope of the let. That implied (once again in my understanding) that the global system-time-locale would not be affected and hence format-time-string would not see the change in the value within the let.

An example like this would have helped me (and possibly shaped the way I use elisp)...

Just my .02 cents, /PA

On Tue, 4 Oct 2022 at 09:52, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
> Date: Tue, 4 Oct 2022 08:46:02 +0200
>
> this is a small patch for the 'Introduction to Emacs LISP programming' guide to show how let works on
> system-wide variables.
> Understanding this would have made my life easier the past +20 years ;-) and an example is sometimes
> worth 100 lines of explanation (more so if you are in a hurry and you do diagonal reading)

This manual already says, in the previous subsection:

     Local variables created by a ‘let’ _expression_ retain their value
  _only_ within the ‘let’ _expression_ itself (and within expressions called
  within the ‘let’ _expression_); the local variables have no effect outside
  the ‘let’ _expression_.

Doesn't this cover the issue?


--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet


reply via email to

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