lua-users home
lua-l archive

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


On Wed, Sep 17, 2014 at 11:20 AM,  <polyglot@openmailbox.org> wrote:
> On 2014-09-18 04:07, Coda Highland wrote:
>>
>> On Wed, Sep 17, 2014 at 8:47 AM,  <polyglot@openmailbox.org> wrote:
>>>
>>> "We use the term sequence to denote a table where the set of all positive
>>> numeric keys is equal to {1..n} for some integer n, which is called the
>>> length of the sequence (see §3.4.6)."
>>
>>
>> n = -42 doesn't count because the definition specifically says
>> "positive numeric keys".
>
>
> Why would n = 0 count but n = -42 not count? They're both
> integers, and neither is a positive numeric key.
>

Ah, sorry, that's an aliasing problem. Different contexts, and I
should have been more cautious in how I phrased it. 0 is just as
irrelevant to the sequenceness of a table as -42 is.

The difference between 0 and -42 in the aforementioned loop iteration
is that 0 is a cardinal number (that is, a number that can be used to
describe the size of a set), but -42 is not.

/s/ Adam