From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: lexical-binding questions Date: Sat, 05 May 2012 09:26:32 -0400 Message-ID: References: <871umzrvfw.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1336224402 4214 80.91.229.3 (5 May 2012 13:26:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 May 2012 13:26:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 05 15:26:41 2012 Return-path: Envelope-to: ged-emacs-devel@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 1SQf0S-0001N4-12 for ged-emacs-devel@m.gmane.org; Sat, 05 May 2012 15:26:40 +0200 Original-Received: from localhost ([::1]:33793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQf0R-0000BN-D1 for ged-emacs-devel@m.gmane.org; Sat, 05 May 2012 09:26:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQf0O-0000At-GZ for emacs-devel@gnu.org; Sat, 05 May 2012 09:26:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQf0M-0002Wb-RR for emacs-devel@gnu.org; Sat, 05 May 2012 09:26:36 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:23125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQf0M-0002WT-NH for emacs-devel@gnu.org; Sat, 05 May 2012 09:26:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYIACxOgk9MCqD5/2dsb2JhbABDuCMDgQyBCIIJAQEEAVYjBQsLNBIUGA0kiBwFtjKLYYR5BKRFgV2DAw X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="178466089" Original-Received: from 76-10-160-249.dsl.teksavvy.com (HELO pastel.home) ([76.10.160.249]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 May 2012 09:26:33 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0840C5910F; Sat, 5 May 2012 09:26:32 -0400 (EDT) In-Reply-To: <871umzrvfw.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 05 May 2012 08:30:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.143.162 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150281 Archived-At: > it seem C-M-x is not working as expected in a `lexical-binding' enabled > buffer: > #+BEGIN_SRC emacs-lisp > ;; -*- lexical-binding: t -*- > (defun foo () > (declare (special bar)) > (let ((bar 2) > (baz 3)) > #'(lambda () (+ bar baz)))) > ;; I expect this: > ;; (funcall (foo)) > ;;=>Symbol's value as variable is void: bar > #+END_SRC > However, (funcall (foo)) return 5 until I byte-compile and load the > file. What makes you think this has something to do with C-M-x? AFAICT it's just a difference between interpreted and compiled code, because CL's (declare (special bar)) has not been adapted to lexical-binding. > So my question is how do you evaluate such code when working in a > `lexical-binding' enabled buffer? You don't use (declare (special bar)). Stefan