[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 16:04:34 +1000
On 2014-09-18 13:46, Andrew Starks wrote:
It seems that the reference manual is written in an exceedingly terse
style that approaches a strict specification.
Some people appear to want it both ways, using an exceedingly
strict mathematical formalism to explain why an empty table should
be a sequence with zero length, but hand-waving when the same
formalism produces empty tables as sequences with random negative
lengths.
Arguably, it's actually *I* who approached the reference manual as
the pragmatic "everyday man" when I suggested that the most
natural reading of this "{1..n} for some integer n" curiosity
is that it produces at least 1 as a positive numeric key.
But apparently I wasn't being "precise" enough, and it was
revealed that 0, being itself an integer, can be used with
a mathematical contortion to produce the empty set, the
result being that an empty table has length 0.
Taking the cue to be more "precise" in my thinking, I suggested
that any integer < 1 produces the empty set, the result being
that an empty table can have some fixed length <= 0 or even some
random length <= 0.
Alas! It turns out that I'm not supposed to be *that*
precise and should revert to approaching the reference as
the pragmatic "everyday man," where pragmatic means being
acrobatically formal but not too acrobatically formal!