lua-users home
lua-l archive

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


> imagine that every table keeps a 'proper' length field, and #t returns it:
> 
> t={1,2,3}     => #t = 3
> t[2] = nil      => #t = 3
> t[3] = nil      => #t =.... ?  should be 1, right?

Maybe; it could be 3 too. It is impossible to know whether you are
erasing element t[3] or simply changing its value to nil ;) After all,
the whole point is to allow nils into arrays. (With no nils, the
current # works fine.)

-- Roberto