lua-users home
lua-l archive

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


Hisham wrote:
<snip>
> Come to think of it, if it did get into standard Lua, I'd even throw
> around the idea of merging array.new() and table.pack(). If we had the
> notion of sequence tables with n and a metatable "in the language", it
> would make sense if table.pack() returned one, and then it's the same
> as array.new().
<snip>

That's a good solution, and we could even avoid the metatable by making '#'
and ipairs check table.n by default, similarly to Lua 5.0 (but without
setlength.) In this sense a table is automatically a "simple" array just by
setting 'n'.

Cheers,
Luis

-- 
Computers are useless. They can only give you answers.
                -- Pablo Picasso

-- 
Luis Carvalho (Kozure)
lua -e 'print((("lexcarvalho@NO.gmail.SPAM.com"):gsub("(%u+%.)","")))'