lua-users home
lua-l archive

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


On Tue, Mar 19, 2013 at 11:18 AM, Ross Bencina
<rossb-lists@audiomulch.com> wrote:
> I wonder whether the language guarantees unique identities for separately
> constructed closures:

Hm, well experimentation shows that functions are still unique objects ;(

$ lua52
Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> f = function() end
> g = function() end
> = f == g
false
> = f
function: 003E9538
> = g
function: 003E97B0

But then, read this: http://lua-users.org/lists/lua-l/2011-06/msg01358.html

Treat anonymous functions as if they were like {}, and yes, the
instinct is then always to precreate!

steve d.