lua-users home
lua-l archive

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


On Saturday, November 23, 2013 06:29:29 AM Roberto Ierusalimschy wrote:
> We are also considering a table.clear function, mainly to help the GC.
> (Not sure about the name, though.)

If you're going to be toying with the table library, how about allowing 
table.insert and table.remove to work with multiple values.

    table.insert(list, value)
    table.insert(list, pos, value, ...)
    table.remove(list, firstpos [, lastpos])

Although remove could perhaps be overloaded to remove all items in a table:

    table.remove(list, "*all")

It's probably more clear to have a distinct table.clear function.

-- 
tom <telliamed@whoopdedo.org>