unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: Dave Pearson <davep.news@davep.org>,
	Gareth Owen <usenet@gwowen.freeserve.co.uk>
Subject: let vs. buffer local bindings
Date: 10 May 2002 16:21:07 +0200	[thread overview]
Message-ID: <5xy9esxewc.fsf@kfs2.cua.dk> (raw)


Gareth Owen <usenet@gwowen.freeserve.co.uk> has found a peculiar
interference between let and buffer local bindings.

Does anyone care to comment on the following result:

First try evalling:

(progn
  (make-variable-buffer-local 'foo)
  (setq-default foo 1)
  (list foo
	(let ((foo 2) (buf (generate-new-buffer "baz")))
	  (set-buffer buf) foo)
	(let ((foo 3) (buf (generate-new-buffer "baz")))
	  (set-buffer buf) foo)
	(let ((foo 4) (buf (generate-new-buffer "baz")))
	  (set-buffer buf) foo)))

which produces what seems to be correct:

  (1 2 3 4)


But now eval this:

(progn
  (setq foo 0)
  (list foo
	(let ((foo 2) (buf (generate-new-buffer "baz")))
	  (set-buffer buf) foo)
	(let ((foo 3) (buf (generate-new-buffer "baz")))
	  (set-buffer buf) foo)
	(let ((foo 4) (buf (generate-new-buffer "baz")))
	  (set-buffer buf) foo)))

which produces what seems to be wrong:

  (0 1 3 4)


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

             reply	other threads:[~2002-05-10 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-10 14:21 Kim F. Storm [this message]
2002-05-10 13:22 ` let vs. buffer local bindings Gareth Owen
2002-05-10 13:48   ` Dave Pearson
2002-05-10 14:53   ` Kim F. Storm
2002-05-10 13:32 ` Andreas Schwab
2002-05-10 15:31   ` Kim F. Storm
2002-05-10 19:15 ` Stefan Monnier
2002-05-10 22:14   ` Kim F. Storm
2002-05-12 16:34     ` Richard Stallman
2002-05-13 20:07       ` Kim F. Storm

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=5xy9esxewc.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=davep.news@davep.org \
    --cc=usenet@gwowen.freeserve.co.uk \
    /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).