[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 11 Jan 2010 11:24:18 -0200
> Yes, n is problematic because it isn't going to work with idioms like
> t[ #t + 1 ] = x.
That is the reason why 'table.pack' does not return the length as a
metamethod's result and why 'pack' (now 'table.pack') does not use
'n' automatically when available.
The explicit use of 'n' (as in "table,unpack(t, 1, t.n)") should remind
the programmer of what is going on.
-- Roberto