lua-users home
lua-l archive

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


On 12/30/10 7:39 PM, Greg Falcon wrote:
On Thu, Dec 30, 2010 at 12:56 AM, Dirk Laurie <dpl@sun.ac.za> wrote:
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.
I disagree with this assessment.  In Lua, nil isn't truly a
first-class object, because it can't be stored in tables at all,
either as a key or a value.  The real problem, as I see it, is the
widespread refusal to accept this fact.

Well, no, I think we were talking about what # does.

That # can be made better is probably mostly discussed
 in the hope to change its current behavior to something more
satisfactorily or intuitive, if it should be changed at all.

Which can't work, as has been shown, because the price would be
to high. So it should probably simply throw an error.

I'd perfectly seriously second eliminating it from the language or
at least from the text books as second best option ...

It really boils down to what audience Lua is for.

A language that starts arrays with 1, mind you.