From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#23781: 25.0.95; read-string with HIST lexically bound Date: Sat, 25 Jun 2016 19:23:57 -0700 (PDT) Message-ID: <3f71a58c-98d9-4ed0-9d16-62d96a263255@default> References: <6bd7ad5e-7319-5f07-4612-26cda5621291@gmail.com> <877fdn96sv.fsf@web.de> <321d46ee-407f-4a6e-93be-302a55da6196@default> <87oa6pwp9d.fsf@gmx.net> <8737o1w15d.fsf@gmx.net> <87y45svs6i.fsf@gmx.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466907932 8894 80.91.229.3 (26 Jun 2016 02:25:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2016 02:25:32 +0000 (UTC) Cc: Michael Heerdegen , Tino Calancha , 23781@debbugs.gnu.org To: Stephen Berman , Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 26 04:25:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bGzl8-0004EY-IG for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Jun 2016 04:25:18 +0200 Original-Received: from localhost ([::1]:52199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGzl4-0007sp-2t for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Jun 2016 22:25:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGzkw-0007rI-9t for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2016 22:25:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGzks-0008EB-0f for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2016 22:25:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGzkr-0008E7-TD for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2016 22:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGzkr-00048z-PJ for bug-gnu-emacs@gnu.org; Sat, 25 Jun 2016 22:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2016 02:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23781-submit@debbugs.gnu.org id=B23781.146690785015870 (code B ref 23781); Sun, 26 Jun 2016 02:25:01 +0000 Original-Received: (at 23781) by debbugs.gnu.org; 26 Jun 2016 02:24:10 +0000 Original-Received: from localhost ([127.0.0.1]:55892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGzk2-00047u-6d for submit@debbugs.gnu.org; Sat, 25 Jun 2016 22:24:10 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:44473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGzk0-00047h-J5 for 23781@debbugs.gnu.org; Sat, 25 Jun 2016 22:24:09 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5Q2O0Ql024352 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 26 Jun 2016 02:24:01 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5Q2O0Lw009692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 26 Jun 2016 02:24:00 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u5Q2NxMK000899; Sun, 26 Jun 2016 02:23:59 GMT In-Reply-To: <87y45svs6i.fsf@gmx.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120081 Archived-At: > > 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 > > =E2=80=98symbol-value=E2=80=99, =E2=80=98boundp=E2=80=99, and =E2= =80=98set=E2=80=99) can only retrieve or modify a > > variable=E2=80=99s dynamic binding (i.e., the contents of its symbo= l=E2=80=99s > > value cell). Also, the code in the body of a =E2=80=98defun=E2=80= =99 or > > =E2=80=98defmacro=E2=80=99 cannot refer to surrounding lexical vari= ables. >=20 > This sounds clearer to me, thanks. >=20 > > Should it be updated any further? (if yes, please reply with concrete > proposals) >=20 > I don't feel competent enough to judge that; however, Drew pointed out > that the `(elisp) Variables' node I quoted from earlier and other places > in the manual haven't been updated for lexical binding. Anyway, these > questions would be more properly assigned to a separate bug report. My comments were probably too simplistic. It would be good for someone to take a close look at all of the doc about symbols, variables, and lexical/dynamic treatment. But it is probably not critical. If someone does that, s?he probably needs to be careful, and the result, if precise, might be too unreadable for our manual. I agree that any such consideration is outside this bug report. FWIW, the CLTL2 section "3. Scope and Extent" is helpful here, even though Emacs Lisp is not Common Lisp. You will soon see there, however, that the relation between symbols and variables is not so straightforward. You will right away see "referencable entities", which have both scope and extent and which become "established" by "the execution of some language construct". Referencable entities include function parameters and other variables, and even `catch' and `throw' tags. I recommend a (re-)reading of that section, asking yourself why this or that term is introduced instead of just referring to words like "variable". None of the terms are introduced gratuitously. So yes, it would be good to be precise in the Elisp manual, but some degree of imprecision can sometimes make for more, not less clarity. ;-) One thing that could perhaps be made more clear in the doc is that the Lisp reader creates symbols (and conses and vectors and...). I'm not sure that this is made clear. These created symbols etc. are used when the objects resulting from reading are later evaluated. IOW, even a referencable entity such as a `catch' tag is associated with a symbol when the `catch' code is read. Likewise, for function parameters and other variables, including variables that use lexical binding.