lua-users home
lua-l archive

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



-----Original Message----- 
> From: "Dirk Laurie" <dirk.laurie@gmail.com> 
> To: "Lua mailing list" <lua-l@lists.lua.org> 
> Date: 02-07-2013 18:09 
> Subject: Re: new "empty" value/type in Lua? 
> 
> 2013/7/2 Thomas Jericke <tjericke@indel.ch>:
> 
> >  the array stores its length 'n' explicitly
> 
> Come back, Lua 5.0! All is forgiven!

Actually I thought 'n' would be hidden in the metatable. The way how it is stored should be implementation detail. The only way to change the length would be myarray:setlength(n) and to get it either #myarray or myarray:getlength()