lua-users home
lua-l archive

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


On 4/14/06, Adrian Sietsma <adrian_groups@sietsma.com> wrote:
> So : I like the behaviour as it is; can I rely on it for the life of 5.1 at
> least? Otherwise, could unpack() default to maxn ?

You are incorrectly assuming the behavior of 5.1 is something other
than it is.  Please be aware that the documented problems of using #
on arrays with nils are not theoretical.  The undefined behavior using
# on arrays with nils exists today.

For instance, I get the following in Lua 5.1:

> =#{nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,1,2,3}
16
> =#{nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,1,2,3}
0

Greg F