[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Creating closures (or not)
- From: Duncan Cross <duncan.cross@...>
- Date: Tue, 13 Jul 2010 12:44:55 +0100
On Tue, Jul 13, 2010 at 12:05 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> Actually, there has been a discussion to implement an optimization
>> that would make these two examples run identically.
>
> Lua 5.2 will have such optimization (thanks to a suggestion from ET).
>
> -- Roberto
>
Excellent to hear this confirmed. Out of curiosity, does it mean that
these "reusable" functions are globally pooled, a bit like strings, or
will it only apply to functions that came from exactly the same place?
For example:
a = function() return 5; end
b = function() return 5; end
...would a and b be the same, or different?
-Duncan