|
On 13.07.2010 19:04, Roberto Ierusalimschy wrote:
The optimization is very strange. When is it really needed? I mean, moving function definitions outside the defining function here and there isn't a problem, unless there's some special case when this happens frequently.My guess is that they would only be pooled if they share the same prototype, and do not use any upvalues, such as: t = {} for i = 1, 10 do t[i] = function() end endThey may be reused even with upvalues, as long as they have the same upvalues; each prototype caches the last closure created with it.
P.S. Waiting for a response about tail call levels :) -- Best regards, Sergey Rozhenko mailto:sergroj@mail.ru