[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: polyglot@...
- Date: Thu, 18 Sep 2014 01:47:59 +1000
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.