Lua 5.2 - small enhancement for table.unpack
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Lua 5.2 - small enhancement for table.unpack
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: 2011年6月29日 09:25:36 +0200
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