[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Does PIL (3rd edition) repeatedly misuse the length operator on tables and invoke undefined behavior?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 17 Sep 2014 18:36:33 +0200
2014-09-17 17:47 GMT+02:00 <polyglot@openmailbox.org>:
> On 2014-09-18 01:02, Coda Highland wrote:
>>
>>
>> This set of keys is {}, the empty set. It IS a member of the set of
>> sets of the form {1..n}, with n = 0.
>
>
> "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)."
>
> Taking n = 0 seems pathological to me, even though 0 is indeed an integer.
> The main problem, however, is that any integer less than 1 produces the
> empty set. Try n = -42 with your for loop.
>
> So the length of the sequence wouldn't be uniquely defined. Obviously
> 0 makes the most sense, but the question is how one gets there from
> the manual.
If you want "non-negative" spelt out, you can find it in the 5.3 manual
in §3.4.7.