From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: lexical-let detail semantics Date: Tue, 28 Jul 2009 02:48:23 +0200 Organization: Informatimago Message-ID: <87iqhdfx9k.fsf@galatea.local> References: <7c63deuuyr.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248745249 30083 80.91.229.12 (28 Jul 2009 01:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jul 2009 01:40:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 28 03:40:43 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MVbgI-0002k1-An for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Jul 2009 03:40:42 +0200 Original-Received: from localhost ([127.0.0.1]:34622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVbgH-0004Vg-MV for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Jul 2009 21:40:41 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-X-Trace: individual.net aB56p8OkgUcDFCqr9GuWDghX3/OAvEz558MgEklsFWUGDfwe/r Cancel-Lock: sha1:NzU4ZDlkODcxYjM1NDI0ZWFiYWFkODFmMTM1MWMyZTY2MDFhM2FmYQ== sha1:6gP9cV97lNc1qqWfgKMdsrn2Mmk= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:171255 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66442 Archived-At: Daniel Kraft writes: > Hm... My main point was whether this is expected behaviour I should > mimic in my implementation, but I take your response that you would > prefer to have my implementation behave differently (like what I > described as my expectation)? Yes. Personnaly, the closer it's to Common Lisp, the better. Instead of providing a lexical-let, I would provide a (with-cl-semantics ...) macro where let, let*, lambda, etc, would behave like in CL, and where (declare (special var)) would be needed to get dynamic binding like in emacs lisp. defun* would include an implicit with-cl-semantics... > Do you think this would lead to compatibility problems with existing code? Be sure to document clearly how it works. You may try to "grep" all the .el you can find to see how lexical-let is used. # locate -r '\.el*$'> /tmp/els # wc -l /tmp/els 58179 /tmp/els # xargs cat < /tmp/els | grep lexical-let | wc -l 3485 That's more uses of lexical-let that I would have expected. You could use a function such as my map-sexps (in http://darcs.informatimago.com/public/emacs/pjb-sources.el ) to find all the occurences of lexical-let and analyse what's in their bodies. As you can see from the various comments, it seems the behavior of lexical-let is changing depending on the version, so it's most probable that no code depend on this yet. -- __Pascal Bourguignon__