[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A question about table's length
- From: Florian Weimer <fw@...>
- Date: Thu, 31 Dec 2009 18:05:52 +0100
* steve donovan:
> So, what ultimately _is_ the array part? What is the least suprising
> definition?
Arrays ae nil-terminated tables, with indices starting at 1 (not
entirely unlike C strings). Storing a nil value into an array has
undefined results.
A couple of weeks ago, I caught up with several months of mailing list
postings, and I noticed that this particular topic (storing nils in
arrays) reoccurred pretty often. I don't think that Lua's behavior is
improper, but it seems to puzzle users quite a bit. In this light,
more predictable behavior would likely make the language easier to
use.