[Date Prev][Date Next][Thread Prev][Thread Next]
- 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
>> 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?
a = function() return 5; end
b = function() return 5; end
...would a and b be the same, or different?