lua-users home
lua-l archive

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


On Fri, Jun 13, 2014 at 10:37 PM, Tim Hill <drtimhill@gmail.com> wrote:
>
> On Jun 13, 2014, at 5:22 PM, Thiago L. <fakedme@gmail.com> wrote:
>
>>>
>>> No, the OP pointed out that the overhead of doing the metamethod test in table.unpack() is low, since it can be done once at the start of unpack(), which then chooses a (fast) rawgeti() based loop or a (generic) index metamethod loop. So you get the best of both worlds in one API.
>>>
>>> —Tim
>>>
>> What if we want raw unpacking of metatabled tables? (aka keep nil as nil)
>
> 1. Save metatable from table
> 2. Set metatable on table to nil
> 3. Unpack it
> 4. Restore metatable
>
> —Tim
>
>

Until someone sets __metatable.

/s/ Adam