[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: table library changes (was Re: table.new in 5.3?)
- From: Tom N Harris <telliamed@...>
- Date: Sat, 23 Nov 2013 19:38:33 -0500
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>