lua-users home
lua-l archive

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


Dirk Laurie <dpl@sun.ac.za> writes:

> All the trouble people have with the table length function and
> the table library, well over 100 posts by now, come down to one
> thing, and one thing only:
>
>     The functions designed for use on tables without holes
>     don't actually give an error message when applied to
>     tables with holes.
>
> Now it is very Lua-like to treat a programmer as a responsible 
> adult, but perhaps just a tiny bit of supervision may be useful.
>
> I suggest this: 
>     a function called table.virgin(t), returning 'true' if the 
>     table t has never had a hole and 'false' otherwise.

Could you choose another name for that concept?  I find the association
of virginity with holes rather inappropriate.

Also, there may be tables that have become externally as well as
internally indistinguishable from virgin, even though they have had a
history involving holes.

So something like "linear" or, if you must, "pure" would seem more
appropriate.

-- 
David Kastrup