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#11407: 24.0.96; Doc for lexical binding in Elisp manual Date: Fri, 4 May 2012 10:10:55 -0700 Message-ID: <0D926161E319481BA418EA6630D79622@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1336151547 24849 80.91.229.3 (4 May 2012 17:12:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 May 2012 17:12:27 +0000 (UTC) To: 11407@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 04 19:12:26 2012 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 1SQM3L-0002az-Qu for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 May 2012 19:12:24 +0200 Original-Received: from localhost ([::1]:45885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQM3L-00027Y-4s for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 May 2012 13:12:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQM3H-00027T-Pt for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:12:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQM3F-00064u-NL for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:12:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQM3F-00064f-Kd for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:12:17 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SQM4v-00060H-VP for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 May 2012 17:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.133615158623001 (code B ref -1); Fri, 04 May 2012 17:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 May 2012 17:13:06 +0000 Original-Received: from localhost ([127.0.0.1]:36275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQM42-0005yv-12 for submit@debbugs.gnu.org; Fri, 04 May 2012 13:13:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35477) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQM3z-0005yT-Kw for submit@debbugs.gnu.org; Fri, 04 May 2012 13:13:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQM2B-0005m1-98 for submit@debbugs.gnu.org; Fri, 04 May 2012 13:11:13 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:55435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQM2B-0005lv-5e for submit@debbugs.gnu.org; Fri, 04 May 2012 13:11:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQM29-000220-BP for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:11:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQM23-0005jN-Jq for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:11:08 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:35940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQM23-0005id-CF for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 13:11:03 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q44HB0ZU007781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 May 2012 17:11:01 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q44HAxmo018460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 4 May 2012 17:11:00 GMT Original-Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q44HAxjU005240 for ; Fri, 4 May 2012 12:10:59 -0500 Original-Received: from dradamslap1 (/10.159.172.28) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 04 May 2012 10:10:59 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac0qGN3oQRsyYDSsQfCjHbL7HyZwfg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59751 Archived-At: With the arrival of lexical scoping in Emacs 24, it is even more important, not less, that the Elisp manual document `lexical-let(*)'. The `lexical-let(*)' doc string too could also be beefed up. It says only this: "Like `let', but lexically scoped. The main visible difference is that lambdas inside BODY will create lexical closures as in Common Lisp." It should include something that lets users know whether such closures close only the vars that are explicitly declared in the `lexical-let(*)' or also the vars that are lexically available. IOW, it should say just what variables are encapsulated in the closures referred to. E.g.: (defun foo (arg) (lexical-let ((beta (something))) #'(lambda () (alpha arg beta)))) Does the closure here treat ARG as lexically bound by the `defun', or is ARG a dynamically bound free var in the lambda? I believe the answer it that the value of ARG encapsulated in the closure is the value that is passed as argument to foo. Whatever the correct answer is, it should be made clear to users. It would be fine to document this stuff together with the other info about lexical bindings, in node (elisp) `Lexical Binding'. But it should be documented somewhere (whatever the exact behavior is). In GNU Emacs 24.0.96.1 (i386-mingw-nt5.1.2600) of 2012-04-28 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.6) --no-opt --enable-checking --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include'