|
Hi Alex, On 8/27/11 3:09 AM, Alexander Gladysh wrote:
On Sat, Aug 27, 2011 at 13:56, Dimiter "malkia" Stanev<malkia@gmail.com> wrote:Here is one more version, still not lj2 friendly, but for some reason very much lua friendly (no closure, using directly next iterator):Now that's a bit crazy. Will have read the bytecode as soon as I'll have time.
Reading the lua docs and wiki it seems that pairs() returns a closure, table, and key. The closure is the next iterator.
Now here I'm directly calling the function next(table, key), instead of the returned closure from pairs(). Probably I'm not doing something legal (metatables? metatable iterators (lua 5.2)?)
Check it again, I can't be sure. Cheers!