lua-users home
lua-l archive

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


On 11 Sep 2006, at 10:50, Dave Nichols wrote:

I disagree, why should an integer index be any more significant than a name?
I think a missing index should be a syntax error as it is now.
Use table.insert instead, it defaults to #+1

The problem with this is that table.insert means a function call (*), whereas the syntax I proposed would be inline. In tight loops, this makes a significant difference.

* It also means an extra table lookup unless you do something like


local tinsert = table.insert

    -- Inside the loop
tinsert( table, key, value )


-Eric