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


Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> a = {}; for i = 1, 2 do a[i] = function () end end
> = a[1] == a[2]
true

-- Roberto