[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Definition of table.insert
- From: David Kastrup <dak@...>
- Date: Tue, 11 Jan 2011 14:19:08 +0100
Axel Kittenberger <firstname.lastname@example.org> writes:
> Indeed, for my taste and coder-newbie-friendliness, it would be nice
> if paranoid lists would be default
Are we still talking about the language or about the mailing lists?
The language does not _have_ lists. It has tables. You can use them
for emulating various other data structures with their own invariants.
Violate the respective invariants, and the emulation suffers. If you
desperately want to make it impossible to violate the invariants, use
appropriate metatables for each emulation prohibiting the violation of
the respective invariant.
But there is little point in reducing the efficiency and versatility of
the _only_ underlying data structure Lua has.