[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Virgin tables
- From: David Kastrup <dak@...>
- Date: Thu, 30 Dec 2010 12:30:46 +0100
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