lua-users home
lua-l archive

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


lhf wrote:

Lua 5.1.2-rc1 is now available at
http://www.lua.org/work/lua-5.1.2-rc1.tar.gz

Woo-hoo!

Please take a look and report any problems.

Here are some corrections to the manual.

There is no explicit mention in the manual that this:

 function vararg(...)
   function nonvararg()
     return ... -- vararg expression
   end
 end

is not allowed.  (The clause "Vararg expressions, denoted by
three dots ('...'), can only be used inside vararg
functions" could be interpreted this way, but it also has a
broader interpretation under which the above example is
legal.)  Here's a patch that fixes this:

--- doc/manual.html 2007-03-23 13:37:11.000000000 -0400
+++ doc/manual.vararg.html 2007-03-25 17:08:23.691875000 -0400
@@ -1404,6 +1404,10 @@
</pre>

<p>
+A vararg expression can only be used if the innermost
+function containing it is a vararg function.
+
+<p>
Results are returned using the <b>return</b> statement (see <a href="#2.4.4">&sect;2.4.4</a>).
If control reaches the end of a function
without encountering a <b>return</b> statement,

When the word "userdata" is used in the manual, it's
consistently used as a singular or plural count noun, except
for two uses as a mass noun, corrected below:

--- doc/manual.html 2007-03-25 17:20:10.238750000 -0400
+++ doc/manual.userdata.html 2007-03-25 17:19:41.238750000 -0400
@@ -3222,7 +3222,7 @@


<p>
-Userdata represents C&nbsp;values in Lua.
+Userdata values represent C&nbsp;values in Lua.
A <em>full userdata</em> represents a block of memory.
It is an object (like a table):
you must create it, it can have its own metatable,
@@ -3498,7 +3498,7 @@


<p>
-Userdata represents C&nbsp;values in Lua.
+Userdata values represent C&nbsp;values in Lua.
A <em>light userdata</em> represents a pointer.
It is a value (like a number):
you do not create it, it has no individual metatable,

(Incidentally, I'm partial to the clarity given by using
"userdatas" as the plural of "userdata" -- this is what Kurt
and I chose to use in our book.  Except...CURSES!!  I see
now that our copyeditor "corrected" some -- not all -- of
these to "userdata".)

One more thing -- I haven't had time to make sure of this,
so pardon me if I'm wrong, but at first glance it looks like
getbinhandler, len_event, and unm_event still don't reflect
the fact that call_binTM only calls a metamethod if it's a
function.  (This was mentioned in a private message to the
Lua team on 2007-09-07.)

--
Aaron
http://arundelo.com