lua-users home
lua-l archive

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

>> I was asked to update wiki page on Lua 5.2 with the data I've gathered
>> from the work releases and posted to this list previously.

> Thanks, it's good to have it in one place.

You're welcome!

> Regarding this excerpt:

> table.unpack() and table.pack()

> unpack() is renamed to table.unpack(). table.pack() is added, packing
> arguments to a table and storing number of arguments to table's field "n".

> I wonder why table.pack() sets "n" in the newly created table? It
> resembles old lua times. Wouldn't it be better (or more in 5.2 spirit)
> to set something like:
> setmetatable(newtable, {_len=function(t) return "n" end})
> where n is the number of arguments packed? Then we could get #newtable
> intstead of newtable.n (or am I missing something?)

It was discussed on the mailing list recently (unfortunately, I do not
remember the conclusion, so, please search for it)

BTW, everyone is welcome to update and add *any* references to the
page! It currently lacks references for most of items.

References are really important, as they provide the context for the
change. They help people to undestand *why*.

Also, this work wouldn't be for vain, as the same references could go
in the community change list for 5.2 release.

Thank you!