[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lexical binding and macros.
From: |
Pascal J. Bourguignon |
Subject: |
Re: Lexical binding and macros. |
Date: |
Wed, 15 Dec 2010 13:38:33 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Elena <egarrulo@gmail.com> writes:
> On Dec 15, 4:24 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
>> >> ehm ... isn't "lexical-let" from the common lisp extension supposed to
>> >> support closures?
>> > They're not really closures.
>>
>> Actually, they are closures. Admittedly, they're not as efficient as
>> one might like, but other than that, they work very well, thank you.
>>
>> Stefan
>
> 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.
Just wait till the garbage collector kicks in.
The variables are named by un-interned symbols. The should be garbage
collected as soon as the 'closures' using them are collected. In your
example, that's immediately, since no closure is created.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
- Lexical binding and macros., Alin Soare, 2010/12/10
- Re: Lexical binding and macros., Barry Margolin, 2010/12/12
- Re: Lexical binding and macros., LanX, 2010/12/13
- Re: Lexical binding and macros., Pascal J. Bourguignon, 2010/12/13
- Re: Lexical binding and macros., Stefan Monnier, 2010/12/15
- Re: Lexical binding and macros., Elena, 2010/12/15
- Re: Lexical binding and macros.,
Pascal J. Bourguignon <=
- Re: Lexical binding and macros., Stefan Monnier, 2010/12/15
- Re: Lexical binding and macros., David Kastrup, 2010/12/15
- Re: Lexical binding and macros., Pascal J. Bourguignon, 2010/12/15
- Re: Lexical binding and macros., Elena, 2010/12/15
- Re: Lexical binding and macros., Stefan Monnier, 2010/12/16