all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: npostavs@users.sourceforge.net
Cc: 27674@debbugs.gnu.org
Subject: bug#27674: 26.0.50; cl-progv: strange scoping due to implementation
Date: Thu, 13 Jul 2017 03:11:37 +0200	[thread overview]
Message-ID: <87zic9dtti.fsf@drachen> (raw)
In-Reply-To: <87o9spdusk.fsf@users.sourceforge.net> (npostavs's message of "Wed, 12 Jul 2017 20:50:35 -0400")

npostavs@users.sourceforge.net writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
> > Sure, but that's something different.  I didn't want a special variable
> > in my example.  The doc of `cl-progv' doesn't mention that the symbols
> > must correspond to special variables.  Do I miss something?
>
> Oh, you expect cl-progv to bind lexically?

Eh - no.  Maybe I have a wrong mental model.  I thought that the free
variable `x' in the lambda is (also) in the scope of the dynamical
binding created by `progv', and because that binding is established
inside the `let' establishing the lexical binding of `x', it would
shadow the lexical binding.

Why does the lambda still refer to the lexical binding?

FWIW I see that this example shows the same behavior:

#+begin_src emacs-lisp
(setq x 'foo)

(let ((x 0))
  (cl-letf (((symbol-value 'x) 1))
    (funcall (lambda () x))))
#+end_src
==> 0

Does a lexical binding always beat a dynamical one?


Michael.





  reply	other threads:[~2017-07-13  1:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 21:53 bug#27674: 26.0.50; cl-progv: strange scoping due to implementation Michael Heerdegen
2017-07-13  0:21 ` npostavs
2017-07-13  0:36   ` Michael Heerdegen
2017-07-13  0:50     ` npostavs
2017-07-13  1:11       ` Michael Heerdegen [this message]
2017-07-13  1:54         ` npostavs
2017-07-13  2:15           ` Michael Heerdegen
2017-07-13  2:41             ` npostavs
2017-07-13 14:40               ` Roland Winkler
2017-07-13 15:07                 ` Noam Postavsky
2017-07-14 14:20                   ` Michael Heerdegen
2017-07-15 20:46                     ` Roland Winkler
2017-07-14 16:00               ` Michael Heerdegen
2017-07-19 13:55             ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=87zic9dtti.fsf@drachen \
    --to=michael_heerdegen@web.de \
    --cc=27674@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.