lua-users home
lua-l archive

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


In message <20160630132301.GB21516@inf.puc-rio.br>
          Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

>> ? How should constructors set length? What are the lengths of {}, {1, 2} and {1, 2, [3]=3} ?
>
>0, 2, and 2.
A typo, I presume. Just testing with
*lua
Lua 5.3.2  Copyright (C) 1994-2015 Lua.org, PUC-Rio
RiscLua 6.3
> x = { 1,2,[3]=3}
> print (#x)
3
> print (#{1,2,[4]="a"})
2
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/