From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: Lexical binding and macros. Date: Wed, 15 Dec 2010 17:16:40 +0100 Organization: Organization?!? Message-ID: <87vd2v8107.fsf@lola.goethe.zz> References: <87r5dmkir6.fsf@kuiper.lan.informatimago.com> <96134923-1314-4675-bd77-004945a7159e@y3g2000vbm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292464272 27567 80.91.229.12 (16 Dec 2010 01:51:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Dec 2010 01:51:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 16 02:51:08 2010 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.69) (envelope-from ) id 1PT2zm-0006Xc-Rt for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 02:51:06 +0100 Original-Received: from localhost ([127.0.0.1]:50597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PT2zj-0001Of-Es for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 20:50:59 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-2.dfn.de!news.dfn.de!news.uni-stuttgart.de!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:HwDTWaVVS2Co5HWJ9HyqLsDExbk= Original-Lines: 25 Original-NNTP-Posting-Date: 15 Dec 2010 17:16:40 CET Original-NNTP-Posting-Host: c563827e.newsspool2.arcor-online.net Original-X-Trace: DXC=I7OnmF0EE22d8Nb@@ZG@b=A9EHlD; 3Yc24Fo<]lROoR18kF5MOK`al0oR:mUBOCndN^n56@QId1m2N3? Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: usenet.stanford.edu gnu.emacs.help:183310 X-Mailman-Approved-At: Wed, 15 Dec 2010 20:50:06 -0500 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:77575 Archived-At: Stefan Monnier writes: >> Do they still leak memory? From http://c2.com/cgi/wiki?EmacsLisp : > >> "Note that variables bound with lexical-let are never released, even >> if they are never used. Try > >> (loop for i from 1 to 100000 collect (lexical-let ((x i)) '())) > >> and watch it eat memory. So making infinity (ZeroOneInfinity) lexical >> variables is out of the question except for very small values of >> infinity." > > Additionally to what Pascal already explained, I'll add that, > lexical-let, like `loop' are relatively heavy macros, so you definitely > don't want to run them interpreted (where the macro is re-expanded each > time). Why would they be reexpanded each time? They are macros. Their expansion is done once and merely evalled each time. Or do I misunderstand something here? -- David Kastrup