From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pedro Andres Aranda Gutierrez Newsgroups: gmane.emacs.devel Subject: Re: PATCH: Explicitly show how let works on global-variables Date: Tue, 4 Oct 2022 10:09:38 +0200 Message-ID: References: <83czb8vxdo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d32bcf05ea30fcd6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31627"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 04 10:37:19 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofdQV-00085B-73 for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 10:37:19 +0200 Original-Received: from localhost ([::1]:36072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofdQT-0003II-Q4 for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 04:37:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofd0E-0000Tn-Gy for emacs-devel@gnu.org; Tue, 04 Oct 2022 04:10:10 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:33669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofd0B-0006dZ-SL; Tue, 04 Oct 2022 04:10:10 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id a13so17810983edj.0; Tue, 04 Oct 2022 01:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=vgSqf5K7Li05eR9qCfp0D+fRibcBnFhTkd4ga/BGoQU=; b=ftuUPgYS0MJ/Ql6jdaR8MbTBJkyKj75Fdj2omiS1hmKc37NEZtJuc+/Ozcbpev7Pyd yuMzm5JS0AoTrpI4U7PngU+M9qtRCCc7AxNb6JRw2WOzF4DZy6Bj3GVMFNmQhZq9nZL+ bFJYuQLk5UMjh0un5n7KXyPwqoRDnb2EGKlFedMPL1XRknQPeUqDKEN6wa9YZd8n8Bzt YAkyHOCSAY5xWK/8IoX2y1tyLxymw5rn1vhTkcDvxNkhevyUNt5qWQRF3vf3niChtOkT kwqDU76mQM0t63/t8Yb16uptpQK0ZKa5Rk9w7w8lJswBEsAaOP0vIjuWsq1qmygsNuFT n0fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=vgSqf5K7Li05eR9qCfp0D+fRibcBnFhTkd4ga/BGoQU=; b=WtBCoK9TET62jjHt0beZUh5xL11wOJfUNKknsmJEDqjpOzBsPk3rjRSRHAxltqmEKR q2ZExtVMyfM4ES3G/nR2qgyXYy917VARVeJWYpan/g17UdqRPB+///EONPbpdBjezAAZ 95X7I/GNLhtBAfUmaw0/q29CDvBW1LxxsLdQDz4Jj2zxw5As5C1fnJxvwHYaL64vqEWh z7VZTG+jzNL0/1dvtCQ21vEB3BjQvm1Etx6ntIUUgBJ9DaTEB1GwZC4K/Y7zdzjXwkj6 VqExPWv4wGvM0p4CnDr5iWtY9geY5VxGvGQAVjK+hH7S9Ne5ueuRhqzPj04gFw21lUYo UPAQ== X-Gm-Message-State: ACrzQf2z0+tFKUxj6v0BttXJm82dRCkoSGQ3b78Gwy4mX+ecNLnCkVVJ 2WIeMt9HCE2cf1aiMYI6wjTDZRtr2Z4Kc6cjF2kbyisu6xR68A== X-Google-Smtp-Source: AMsMyM6sSiWok7ZeZzrqzrgHA+ep7xKIfUtEHGaXq1TrZAoa7baSXs3l8WRN5mQ8WD51YlIZDQjRDT7vGdnjRykvvPg= X-Received: by 2002:a05:6402:1f89:b0:453:8093:c4e5 with SMTP id c9-20020a0564021f8900b004538093c4e5mr22944495edc.182.1664871004579; Tue, 04 Oct 2022 01:10:04 -0700 (PDT) In-Reply-To: <83czb8vxdo.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=paaguti@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296858 Archived-At: --000000000000d32bcf05ea30fcd6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 wrote: > > From: Pedro Andres Aranda Gutierrez > > 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 d= o > diagonal reading) > > This manual already says, in the previous subsection: > > Local variables created by a =E2=80=98let=E2=80=99 expression retain= their value > _only_ within the =E2=80=98let=E2=80=99 expression itself (and within e= xpressions called > within the =E2=80=98let=E2=80=99 expression); the local variables have = no effect outside > the =E2=80=98let=E2=80=99 expression. > > Doesn't this cover the issue? > --=20 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 --000000000000d32bcf05ea30fcd6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli,=

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

As I understood the text (and to contin= ue with the=C2=A0system-time-locale) I understood as local variable a '= value that was stored in the function's stack' to be used in the sc= ope of the let. That implied (once again in my understanding) that the glob= al system-time-locale would not be affected and hence=C2=A0format-time-stri= ng would not see the change in the value within the let.

An example like this would have helped me (and possibly shaped the w= ay 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 &= lt;paaguti@gmail.com= >
> Date: Tue, 4 Oct 2022 08:46:02 +0200
>
> this is a small patch for the 'Introduction to Emacs LISP programm= ing' 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:

=C2=A0 =C2=A0 =C2=A0Local variables created by a =E2=80=98let=E2=80=99 expr= ession retain their value
=C2=A0 _only_ within the =E2=80=98let=E2=80=99 expression itself (and withi= n expressions called
=C2=A0 within the =E2=80=98let=E2=80=99 expression); the local variables ha= ve no effect outside
=C2=A0 the =E2=80=98let=E2=80=99 expression.

Doesn't this cover the issue?


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

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

--000000000000d32bcf05ea30fcd6--