On Wed, Sep 17, 2014 at 1:01 PM, <polyglot@openmailbox.org> wrote:
On 2014-09-18 05:17, Coda Highland wrote:
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.
That's why 0 makes more sense than -42, but the trouble with undefined
behavior is that it's not required to do what makes more sense. The
length value of -42 for an empty table seems perfectly consistent
with the wording of the 5.2 reference manual.
I'm pretty sure you missed my point. The definition in the 5.2 manual
DOES explicitly say that an empty table has a length of 0. It doesn't
special-case it, but that IS a consequence of the definition
presented. It's not "you can assume it" -- it's "it's guaranteed." The
wording isn't ambiguous, just complicated.