unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	Tino Calancha <f92capac@gmail.com>,
	23781@debbugs.gnu.org
Subject: bug#23781: 25.0.95; read-string with HIST lexically bound
Date: Sat, 25 Jun 2016 15:46:38 -0400	[thread overview]
Message-ID: <CAM-tV-9yJbozKAQLU6jyKXcXjNovjQ2zukDU3BaA5TTX6Vuqmw@mail.gmail.com> (raw)
In-Reply-To: <8737o1w15d.fsf@gmx.net>

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

On Sat, Jun 25, 2016 at 2:53 PM, Stephen Berman <stephen.berman@gmx.net> wrote:
> But maybe
> we should leave the bike shed before this gets too philosophical ;-)

Ugh, yes please.

So can we agree on this updated wording? (as shown in attached patch)

       Note that unlike dynamic variables which are tied to the symbol
    object itself, the relationship between lexical variables and
    symbols is only present in the interpreter (or compiler).
    Therefore, functions which take a symbol argument (like
    ‘symbol-value’, ‘boundp’, and ‘set’) can only retrieve or modify a
    variable’s dynamic binding (i.e., the contents of its symbol’s
    value cell).  Also, the code in the body of a ‘defun’ or
    ‘defmacro’ cannot refer to surrounding lexical variables.

Should it be updated any further? (if yes, please reply with concrete proposals)

[-- Attachment #2: 0001-Clarify-lexical-binding-with-symbol-args-behavior.patch --]
[-- Type: text/x-patch, Size: 2145 bytes --]

From 151c2837dc5c82073465f6b68e0216a0e8149cf7 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Fri, 24 Jun 2016 20:39:24 -0400
Subject: [PATCH] Clarify lexical binding with symbol args behavior

* doc/lispref/variables.texi (Lexical Binding): Clarify that symbol
arguments always refer to dynamic values (Bug #23781).
---
 doc/lispref/variables.texi | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 6c53e9b..b4d6857 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -974,7 +974,7 @@ Lexical Binding
 
 @cindex lexical environment
   Here is how lexical binding works.  Each binding construct defines a
-@dfn{lexical environment}, specifying the symbols that are bound
+@dfn{lexical environment}, specifying the variables that are bound
 within the construct and their local values.  When the Lisp evaluator
 wants the current value of a variable, it looks first in the lexical
 environment; if the variable is not specified in there, it looks in
@@ -1032,11 +1032,14 @@ Lexical Binding
 time we evaluate the closure, it increments @code{x}, using the
 binding of @code{x} in that lexical environment.
 
-  Note that functions like @code{symbol-value}, @code{boundp}, and
-@code{set} only retrieve or modify a variable's dynamic binding
-(i.e., the contents of its symbol's value cell).  Also, the code in
-the body of a @code{defun} or @code{defmacro} cannot refer to
-surrounding lexical variables.
+  Note that unlike dynamic variables which are tied to the symbol
+object itself, the relationship between lexical variables and symbols
+is only present in the interpreter (or compiler).  Therefore,
+functions which take a symbol argument (like @code{symbol-value},
+@code{boundp}, and @code{set}) can only retrieve or modify a
+variable's dynamic binding (i.e., the contents of its symbol's value
+cell).  Also, the code in the body of a @code{defun} or
+@code{defmacro} cannot refer to surrounding lexical variables.
 
 @node Using Lexical Binding
 @subsection Using Lexical Binding
-- 
2.8.0


  reply	other threads:[~2016-06-25 19:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  5:19 bug#23781: 25.0.95; read-string with HIST lexically bound Tino Calancha
2016-06-17 15:25 ` Michael Heerdegen
2016-06-23 23:01   ` Noam Postavsky
2016-06-23 23:18     ` Drew Adams
2016-06-25  0:26       ` Noam Postavsky
2016-06-25 10:12         ` Stephen Berman
2016-06-25 16:53           ` Noam Postavsky
2016-06-25 18:53             ` Stephen Berman
2016-06-25 19:46               ` Noam Postavsky [this message]
2016-06-25 22:07                 ` Stephen Berman
2016-06-25 23:42                   ` Michael Heerdegen
2016-06-26  3:34                     ` Noam Postavsky
2016-06-27  0:55                       ` Noam Postavsky
2016-07-01  4:07                         ` npostavs
2016-06-26  2:23                   ` Drew Adams
2016-06-25 21:00               ` Drew Adams
2016-06-25 20:42             ` Drew Adams
2016-06-24  2:24     ` Tino Calancha

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=CAM-tV-9yJbozKAQLU6jyKXcXjNovjQ2zukDU3BaA5TTX6Vuqmw@mail.gmail.com \
    --to=npostavs@users.sourceforge.net \
    --cc=23781@debbugs.gnu.org \
    --cc=f92capac@gmail.com \
    --cc=michael_heerdegen@web.de \
    --cc=stephen.berman@gmx.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 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).