lua-users home
lua-l archive

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

On 7/25/2012 8:30 PM, Coda Highland wrote:
On Wed, Jul 25, 2012 at 9:46 PM, Jay Carlson <> wrote:
On Jul 25, 2012, at 5:09 PM, Coda Highland wrote:

On Wed, Jul 25, 2012 at 2:02 PM, Dimiter 'malkia' Stanev
<> wrote:
-- "function() end" would gurantee an unique value, differentiated from
others, unless the VM merges it under one umbrella. Even them, maybe reusing
coroutine might return you an unique value for the lifetime of the
application (or something even simpler)

Unless I miss my guess, the VM couldn't merge it because they'd have
different upvalues.

There are no free variables in function() end and hence no upvalues, so it certainly could be merged/hoisted to chunk level.

Oh right. Silly me.

Put me in the silly list too :)

After seeing it done much simpler ...

Use NULL={} instead. List constructors guarantee uniqueness.


*nods* And tables have reference equality only, so that's completely sufficient.

/s/ Adam