[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Nnitpicks in the Lua 5.1 Reference Manual
- From: David Jones <drj@...>
- Date: Wed, 29 Mar 2006 09:13:01 +0100
Good work on the 5.1 release, I look forward to using it.
Naturally there are some very minor mistakes in the reference manual.
The description of tonumber(e, base) can be read to imply that
tonumber('c', 11) would be 12. You need to say that "Characters
representing numbers that are not smaller than the specified base are
invalid". Let's not forget that until ANSI said otherwise many C
compilers treated 089 as a valid "octal" constant.
Section 2.2 says tables "can contain values of all types (except nil)",
but this is inconsistent with ipairs which says "up to the first
integer key with a nil value in the table" (keys can't have nil
values), and "next" which says "There is no difference between a field
not present in a table or a field with value nil". Overall I think
it's slightly more consistent to say that tables can have fields with
value nil but that the iterators ignore fields with a nil value. Then
you might need to change the last paragraph of the description of
"next" to say "The behavior of next is undefined if, during the
traversal, you assign any value to a field that previously had a nil
2.5.5 The Length Operator should say "The length of a table t is
defined to be any non-negative integer index n such that ..."
Section 2.5.9 has the sentence: "If a vararg expression is used inside
another expression or in the middle of a list of expressions, then its
return list is adjusted to one element." The phrase "its return list"
is confusing. The return list of what? What's a return list anyway?
I think it would be better to just say "it" or "the vararg expression"
instead of "its return list".