lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, May 23, 2010 at 11:24 AM, Jonathan Castello <twisolar@gmail.com> wrote:
> On Sun, May 23, 2010 at 8:42 AM, Mark Hamburg <mark@grubmah.com> wrote:
>> Does this mean that the compiler could now detect functions without upvalue references and treat them as constants so that we don't reconstruct them over and over again? (The presence of function environments stood in the way of doing so in the past.)
>>
>> Today, one could lift such definitions out of the code and explicitly store them in local variables, but doing so can break the flow of the code for reading.
>>
>> Mark
>>
>>
>
> Correct me if I'm wrong, but isn't that what light C functions are?
>
> http://www.corsix.org/content/look-lua-52-work3 -- point 6.
>
> ~Jonathan
>

Oh, I see, you're talking specifically about Lua functions, aren't you?

function a_silly_closure()
  return function() --[[ no upvalues ]] end
end

My mistake.

~Jonathan