aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-01-21 15:45:11 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-01-21 15:45:11 -0200
commit3b5158f2a1d7e44bc67bab5c443bf034c0e2cb47 (patch)
tree5374521878687ccd0a30a15b767bdd6926b10bcc
parent60a8b94fd0e865fab202fbbd61f211fb4fde8181 (diff)
downloadlua-3b5158f2a1d7e44bc67bab5c443bf034c0e2cb47.tar.gz
lua-3b5158f2a1d7e44bc67bab5c443bf034c0e2cb47.tar.bz2
lua-3b5158f2a1d7e44bc67bab5c443bf034c0e2cb47.zip
corrections from Asko Kauppi
-rw-r--r--manual.tex33
1 files changed, 16 insertions, 17 deletions
diff --git a/manual.tex b/manual.tex
index fdba4a8d..8d1d6fef 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 1.64 2002/12/11 13:43:15 roberto Exp roberto $ 1% $Id: manual.tex,v 1.65 2003/01/20 11:03:05 roberto Exp roberto $
2%{[( 2%{[(
3 3
4\documentclass[11pt,twoside]{article} 4\documentclass[11pt,twoside]{article}
@@ -134,7 +134,7 @@ Waldemar Celes
134\tecgraf\ --- Computer Science Department --- PUC-Rio 134\tecgraf\ --- Computer Science Department --- PUC-Rio
135} 135}
136 136
137%\date{{\small \tt\$Date: 2002/12/11 13:43:15 $ $}} 137%\date{{\small \tt\$Date: 2003/01/20 11:03:05 $ $}}
138 138
139\maketitle 139\maketitle
140 140
@@ -570,8 +570,10 @@ and can contain the C-like escape sequences
570`\verb|\t|' (horizontal tab), 570`\verb|\t|' (horizontal tab),
571`\verb|\v|' (vertical tab), 571`\verb|\v|' (vertical tab),
572`\verb|\\|' (backslash), 572`\verb|\\|' (backslash),
573`\verb|\"|' (double quote), 573`\verb|\"|' (quotation mark),
574`\verb|\'|' (single quote), 574`\verb|\'|' (apostrophe),
575`\verb|\[|' (left square bracket),
576`\verb|\]|' (right square bracket),
575and `\verb|\|\emph{newline}' (that is, a backslash followed by a real newline, 577and `\verb|\|\emph{newline}' (that is, a backslash followed by a real newline,
576which results in a newline in the string). 578which results in a newline in the string).
577A character in a string may also be specified by its numerical value 579A character in a string may also be specified by its numerical value
@@ -1393,7 +1395,7 @@ functions \verb|setmetatable| and \verb|getmetatable| \see{pdf-getmetatable}.
1393For each of those operations Lua associates a specific key 1395For each of those operations Lua associates a specific key
1394called an \emph{event}. 1396called an \emph{event}.
1395When Lua performs one of those operations over a table or a userdata, 1397When Lua performs one of those operations over a table or a userdata,
1396if checks whether that object has a metatable with the corresponding event. 1398it checks whether that object has a metatable with the corresponding event.
1397If so, the value associated with that key (the \IndexEmph{metamethod}) 1399If so, the value associated with that key (the \IndexEmph{metamethod})
1398controls how Lua will perform the operation. 1400controls how Lua will perform the operation.
1399 1401
@@ -1519,11 +1521,11 @@ the \verb|<| operation.
1519\item[``le'':]\IndexTM{lt} 1521\item[``le'':]\IndexTM{lt}
1520the \verb|<=| operation. 1522the \verb|<=| operation.
1521\begin{verbatim} 1523\begin{verbatim}
1522 function lt_event (op1, op2) 1524 function le_event (op1, op2)
1523 if type(op1) == "number" and type(op2) == "number" then 1525 if type(op1) == "number" and type(op2) == "number" then
1524 return op1 < op2 -- numeric comparison 1526 return op1 <= op2 -- numeric comparison
1525 elseif type(op1) == "string" and type(op2) == "string" then 1527 elseif type(op1) == "string" and type(op2) == "string" then
1526 return op1 < op2 -- lexicographic comparison 1528 return op1 <= op2 -- lexicographic comparison
1527 else 1529 else
1528 local h = getbinhandler(op1, op2, "__le") 1530 local h = getbinhandler(op1, op2, "__le")
1529 if h then 1531 if h then
@@ -1804,13 +1806,10 @@ like a daemon or a web server ---
1804might need to release states as soon as they are not needed, 1806might need to release states as soon as they are not needed,
1805to avoid growing too large. 1807to avoid growing too large.
1806 1808
1807With the exception of \verb|lua_open|,
1808all functions in the Lua API need a state as their first argument.
1809
1810 1809
1811\subsection{Threads} 1810\subsection{Threads}
1812 1811
1813Lua offers a partial support for multiple threads of execution. 1812Lua offers partial support for multiple threads of execution.
1814If you have a C~library that offers multi-threading, 1813If you have a C~library that offers multi-threading,
1815then Lua can cooperate with it to implement the equivalent facility in Lua. 1814then Lua can cooperate with it to implement the equivalent facility in Lua.
1816Also, Lua implements its own coroutine system on top of threads. 1815Also, Lua implements its own coroutine system on top of threads.
@@ -2247,7 +2246,7 @@ and then it frees its corresponding memory.
2247 2246
2248\subsection{Metatables} 2247\subsection{Metatables}
2249 2248
2250The following functions allow you do manipulate the metatables 2249The following functions allow you to manipulate the metatables
2251of an object: 2250of an object:
2252\begin{verbatim} 2251\begin{verbatim}
2253 int lua_getmetatable (lua_State *L, int objindex); 2252 int lua_getmetatable (lua_State *L, int objindex);
@@ -2338,7 +2337,7 @@ The table is left where it was in the stack;
2338this is convenient for getting multiple values from a table. 2337this is convenient for getting multiple values from a table.
2339 2338
2340As in Lua, this function may trigger a metamethod 2339As in Lua, this function may trigger a metamethod
2341for the ``gettable'' or ``index'' events \see{metatable}. 2340for the ``index'' event \see{metatable}.
2342To get the real value of any table key, 2341To get the real value of any table key,
2343without invoking any metamethod, 2342without invoking any metamethod,
2344use the \emph{raw} version: 2343use the \emph{raw} version:
@@ -2989,7 +2988,7 @@ The current content of this string is {\tt "Lua \Version"}.
2989 2988
2990\subsubsection*{\ff \T{assert (v [, message])}}\DefLIB{assert} 2989\subsubsection*{\ff \T{assert (v [, message])}}\DefLIB{assert}
2991Issues an \emph{``assertion failed!''} error 2990Issues an \emph{``assertion failed!''} error
2992when its argument \verb|v| is \nil; 2991when its argument \verb|v| is \nil{} or \false;
2993otherwise, returns this argument. 2992otherwise, returns this argument.
2994This function is equivalent to the following Lua function: 2993This function is equivalent to the following Lua function:
2995\begin{verbatim} 2994\begin{verbatim}
@@ -3692,10 +3691,10 @@ so that subsequent calls to \verb|table.getn(table)| return \verb|n|.
3692This library is an interface to most of the functions of the 3691This library is an interface to most of the functions of the
3693standard C~math library. 3692standard C~math library.
3694(Some have slightly different names.) 3693(Some have slightly different names.)
3695It provides all its functions inside the table \verb|math|\DefLIB{math}. 3694It provides all its functions inside the table \IndexLIB{math}.
3696In addition, 3695In addition,
3697it registers a ??tag method for the binary exponentiation operator \verb|^| 3696it registers a ??tag method for the binary exponentiation operator \verb|^|
3698that returns \Math{x^y} when applied to numbers \verb|x^y|. 3697that returns \Math{x^y} when applied to numbers \verb|x| and \verb|y|.
3699 3698
3700The library provides the following functions: 3699The library provides the following functions:
3701\DefLIB{math.abs}\DefLIB{math.acos}\DefLIB{math.asin}\DefLIB{math.atan} 3700\DefLIB{math.abs}\DefLIB{math.acos}\DefLIB{math.asin}\DefLIB{math.atan}