unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: 9469@debbugs.gnu.org
Subject: bug#9469: buffer-local variables seem to remember previous values
Date: Tue, 13 Sep 2011 22:42:34 +0200	[thread overview]
Message-ID: <m2zki8gon9.fsf@gmail.com> (raw)
In-Reply-To: <CAM=K+ipbSAqy1PLo=qHRb_SqtKU+M6B1RRDv_LPym3P1ir2W4Q@mail.gmail.com>

* Drew Adams [2011-09-13 18:52] writes:

[...]
> The Lisp reader is kind of in the background of user awareness, so the
> question of where the Lisp object comes from can mistakenly be
> answered by thinking that it is `quote' that creates it based on the
> text/sexp that follows the '.  That, I think, is the gotcha that
> tripped up Le (and he's not alone).

Yes, that's crucial.  Beginners need to understand that read and eval
are separate and what the purpose of each is: read turns text into
s-expressions.  eval "executes" s-expressions; eval is described in
terms of s-expressions and not text.  Also that the reader is not the
only way to construct s-expressions for eval.

[...]
> Given that understanding, what can also be missing is that, depending
> on the Lisp, the Lisp reader might not create a _new_ list each time
> it encounters the sexp "(a b c)".  And in Emacs Lisp it in fact does
> not create a new list; it reuses a previously created list, if
> available.  (Is that always true for Elisp?  What about gc?).

I've never heard of a reader that does what you describe here.  The
reader creates a new list for "'foo" just as for "(quote foo)" or for
"(bar foo)".

(eq (read "'a") (read "'a")) returns nil; all the time.

Just like
(let ((sexp (read "('a 'a)")))
  (eq (car sexp) 
      (cadr sexp)))
is always nil.

The reader interns symbols but lists and vectors are freshly created
(ignoring the #1# syntax for now).  The compiler may coalesce constant
lists that are equal; but don't let us confuse the reader with the
compiler.

Helmut






  reply	other threads:[~2011-09-13 20:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-10 17:07 bug#9469: buffer-local variables seem to remember previous values Le Wang
2011-09-10 17:44 ` Drew Adams
2011-09-11 16:57   ` Le Wang
2011-09-11 17:56     ` Drew Adams
2011-09-11 18:08       ` Andreas Schwab
2011-09-11 18:49         ` Le Wang
2011-09-11 18:54           ` Lars Magne Ingebrigtsen
2011-09-11 19:18             ` Le Wang
2011-09-11 19:54               ` Lars Magne Ingebrigtsen
2011-09-12  4:39                 ` Le Wang
2011-09-12  7:57                   ` Andreas Schwab
2011-09-12  8:23                     ` Le Wang
2011-09-12  8:35                       ` Andreas Schwab
2011-09-12 14:30                         ` Drew Adams
2011-09-12 15:06                         ` Le Wang
2011-09-13 12:54                   ` Stefan Monnier
2011-09-13 13:12                     ` Le Wang
2011-09-13 15:00                     ` Helmut Eller
2011-09-13 18:02                     ` Johan Bockgård
2011-09-13 18:52                       ` Drew Adams
2011-09-13 20:42                         ` Helmut Eller [this message]
2011-09-15 18:14                       ` Le Wang
2011-09-11 19:37             ` Helmut Eller
2011-09-11 19:46           ` Andreas Schwab

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=m2zki8gon9.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=9469@debbugs.gnu.org \
    /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).