unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: tomas@tuxteam.de
Cc: emacs-devel@gnu.org
Subject: Re: PATCH: Explicitly show how let works on global-variables
Date: Wed, 05 Oct 2022 00:56:11 +1300	[thread overview]
Message-ID: <abb1cf5f7d21b75214ba09d50b9aca5a@webmail.orcon.net.nz> (raw)
In-Reply-To: <Yzvn1XDBOBVYP1J/@tuxteam.de>

On 2022-10-04 20:59, tomas@tuxteam.de wrote:
> I think this is technically wrong and potentially confusing.
> 
> I'd tend to say that a new binding is created which shadows the
> global binding. The `system-time-locale' in your let-bound scope
> is a different variable from the global one, although it has the
> same name.
> 
> More importantly, nothing gets "restored": it's just the compiler
> which sees a different variable depending on scope. This is even
> "more true" (I know, I know) with lexical variables.

I think this is technically wrong and potentially confusing :)

(info "(elisp)Dynamic Binding") explains it pretty clearly:

    "Dynamic binding is implemented in Emacs Lisp in a simple way.  Each
symbol has a value cell, which specifies its current dynamic value (or
absence of value).  *Note Symbol Components::.  When a symbol is given a
dynamic local binding, Emacs records the contents of the value cell (or
absence thereof) in a stack, and stores the new local value in the value
cell.  When the binding construct finishes executing, Emacs pops the old
value off the stack, and puts it in the value cell."




  reply	other threads:[~2022-10-04 11:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04  6:46 PATCH: Explicitly show how let works on global-variables Pedro Andres Aranda Gutierrez
2022-10-04  7:52 ` Eli Zaretskii
2022-10-04  8:09   ` Pedro Andres Aranda Gutierrez
2022-10-04 11:36     ` Phil Sainty
2022-10-04 13:43       ` Stefan Monnier
2022-10-04 22:22       ` Tim Cross
2022-10-05  5:28         ` Pedro Andres Aranda Gutierrez
2022-10-06  9:00           ` Pedro Andres Aranda Gutierrez
2022-10-06 19:34             ` Emanuel Berg
2022-10-04 17:39   ` Richard Stallman
2022-10-04  7:59 ` tomas
2022-10-04 11:56   ` Phil Sainty [this message]
2022-10-04 13:48     ` Stefan Monnier
2022-10-05 21:31     ` Richard Stallman
2022-10-04 15:00 ` [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abb1cf5f7d21b75214ba09d50b9aca5a@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=emacs-devel@gnu.org \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).