lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

2015-02-11 6:22 GMT+02:00 张睿 <>:

> Moreover, what is the exact relationship between a valid index and a pseudo
> index? The manual has its inconsistency:
> The manual says that a valid index refers to a real stack postition, whereas
> a pseudo index does not. So by definition they are totally different things.
> No pseudo index can be a valid index.
> But, in section 4.3:
> An acceptable index can be any valid index, including the pseudo-indices,
> but it also can be any positive index after the stack top within the space
> allocated for the stack, that is, indices up to the stack size.
> The word "including" seems to indicate that pseudo-indices are included in
> valid index, which contradicts the definition.

The authors of the manual could have chosen to distinguish between
a validindex (which would be a precisely defined term) and a valid index
(which is an index that happens to be valid in the context).

They chose instead to say explicitly each time when a pseudoindex
is not valid. IMO that serves the purpose of the manual, which is to help
programmers to use the language and API correctly, better than
introducing another term which differs only in its use of whitespace.

If the document was called "Specification" instead of "Manual", the
degree of pedantry on which you seem to insist would be essential.
In a Manual it is uncalled for. The word "Manual" means "handbook",
implying that smallness and convenience are main design goals.