lua-users home
lua-l archive

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


I thought I understodd Lua tables, but obviously not.
Would someone explain the rules that cover the following
(5.1) behaviour  of '#':

> a={nil,2,3,4,5,6}
> =#a
6

> a={1,2,3,4,5,6}
> =#a
6
> a[1]=nil
> =#a
6

> a={[2]=2, [3]=3}
> =#a
0
> a[1]=1
> =#a
3
> a[1]=nil
> =#a
3

David B.