lua-users home
lua-l archive

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


Hi all!

I'd like to suggest a small enhancement for table.unpack.

I propose to add this usage case:


table.unpack( t, '#' )


that would be equivalent to:


table.unpack( t, 1, t.n or #t )


Rationale:

1. make table.unpack usage more symmetric with new table.pack, so that a table created by pack could be unpacked more easily.

2. the implementation could be optimized to minimize accesses to t.


Thanks for reading.

Cheers.
-- Lorenzo