lua-users home
lua-l archive

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


Francisco Olarte wrote:

If you can spare enough memory for a copy of a list, you can do anything you want by just processing it sequentially ...

First post here.  :-)

I'm new to Lua, but I've used Perl a lot; and Perl is also an interpreted language that uses tables ("hashes" or associative arrays) as a major data structure. My approach would be to copy the original table to a new one, leaving out the unwanted entries. Then the old table can be discarded, and hopefully it will be garbage-collected in due course.

If plenty of memory is available, why not make use of it? But if memory is tight, one might not be able to afford the luxury of two large tables.

David