[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua 5.3.0-rc3 - some manual issues.
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Sun, 04 Jan 2015 16:55:20 +0100
In section 2.5.1, 3rd paragraph, there seems to be a punctuation issue:
After the collection, Lua goes through that list: For each object in the
list, it checks the object's __gc metamethod; if it is a function, Lua
calls it with the object as its single argument. If the metamethod is
not a function, Lua simply ignores it.
probably should read:
After the collection, Lua goes through that list. For each object in the
list, it checks the object's __gc metamethod: if it is a function, Lua
calls it with the object as its single argument; if the metamethod is
not a function, Lua simply ignores it.
The upercase "For" seems to call for this change and the sentence sounds
more fluid.
========================================================================
Same section 2.5.1, 5th paragraph, the first sentence doesn't sound
"right" (that "that" is the culprit IMHO, but maybe a native English
speaker should check it - I could be wrong here, but there is a missing
preposition "in" and that calls for a "which".)
At the end of each garbage-collection cycle, the finalizers for objects
are called in the reverse order *that* the objects were marked for
finalization, among those collected in that cycle;
I suggest changing it to:
At the end of each garbage-collection cycle, the finalizers for objects
are called in the reverse order *in which* the objects were marked for
finalization, among those collected in that cycle;
The same problem is in the last paragraph of the same section:
When you close a state (see lua_close), Lua calls the finalizers of all
objects marked for finalization, following the reverse order *that* they
were marked.
========================================================================
In section 4.6, 3rd paragraph, there is a verb-plural mismatch:
However, there *is no guarantees* about stack space.
It should be either "are no guarantees" or "is no guarantee".
========================================================================
In section 4.7, 6th paragraph (after the first code snippet):
Now we want to allow the Lua code being *ran* by lua_pcall to yield.
Should be:
Now we want to allow the Lua code being *run* by lua_pcall to yield.
And in the 7th paragraph:
Now, we must inform Lua that it must call k if the Lua code *begin
running* by lua_pcall gets interrupted in some way (errors or yielding),
Should be (probably, if I get the meaning well):
Now, we must inform Lua that it must call k if the Lua code *being run*
by lua_pcall gets interrupted in some way (errors or yielding),
or
Now, we must inform Lua that it must call k if the Lua code *about to be
run* by lua_pcall gets interrupted in some way (errors or yielding),
========================================================================
In section 4.7, paragraph before the last, there is a punctuation typo
(swapped full-stop and closing parenthesis):
(For these two functions, Lua will not call the continuation in case of
errors, because they do not handle errors*.)*
And again in the last sentence:
(For lua_yieldk, there is not much point in calling directly the
continuation function, because lua_yieldk usually does not return*.) *
And similarly in the last paragraph:
The continuation function receives the same Lua stack from the original
function, in the same state it would be if the callee function had
returned*. (*For instance, after a lua_callk the function and its
arguments are removed from the stack and replaced by the results from
the call*.)* It also has the same upvalues. Whatever it returns is
handled by Lua as if it were the return of the original function.
Should be:
The continuation function receives the same Lua stack from the original
function, in the same state it would be if the callee function had
returned (for instance, after a lua_callk the function and its arguments
are removed from the stack and replaced by the results from the call).
It also has the same upvalues. Whatever it returns is handled by Lua as
if it were the return of the original function.
========================================================================
Cheers!
-- Lorenzo
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments