[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Clean Lua
- From: Ignacio Burgueño <ignaciob@...>
- Date: Fri, 18 Nov 2011 23:45:57 -0200
On Fri, Nov 18, 2011 at 10:43 PM, William C. Bubel <email@example.com>
On 11/18/2011 11:41 AM, GrayFace wrote:> ...
> What I don't like about 5.2 is that 5.1 is cleaner in many ways.
> function definitions always produce a new functionCan somebody clarify this for me? What's the situation in 5.2 where the
function keyword wouldn't produce a function object?
local function bar()
In Lua 5.1, a call to function "foo" will create a new instance of function "bar" each time. Lua 5.2 will create only one instance if "bar" has the same upvalues each time.