aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manual.tex39
1 files changed, 21 insertions, 18 deletions
diff --git a/manual.tex b/manual.tex
index 94cb3d58..9966b9ba 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 2.13 1997/09/16 19:01:10 roberto Exp $ 1% $Id: manual.tex,v 1.1 1998/01/02 18:34:00 roberto Exp roberto $
2 2
3\documentstyle[fullpage,11pt,bnf]{article} 3\documentstyle[fullpage,11pt,bnf]{article}
4 4
@@ -38,7 +38,7 @@ Waldemar Celes
38\tecgraf\ --- Computer Science Department --- PUC-Rio 38\tecgraf\ --- Computer Science Department --- PUC-Rio
39} 39}
40 40
41\date{\small \verb$Date: 1997/09/16 19:01:10 $} 41\date{\small \verb$Date: 1998/01/02 18:34:00 $}
42 42
43\maketitle 43\maketitle
44 44
@@ -486,7 +486,7 @@ function calls can be executed as statements:
486\produc{stat}{functioncall} 486\produc{stat}{functioncall}
487\end{Produc}% 487\end{Produc}%
488In this case, returned values are thrown away. 488In this case, returned values are thrown away.
489Function calls are explained in Section~\ref{functioncall}. 489Function calls are explained in \See{functioncall}.
490 490
491\subsubsection{Local Declarations} \label{localvar} 491\subsubsection{Local Declarations} \label{localvar}
492\Index{Local variables} may be declared anywhere inside a block. 492\Index{Local variables} may be declared anywhere inside a block.
@@ -522,11 +522,11 @@ Basic expressions are:
522\end{Produc}% 522\end{Produc}%
523 523
524Numbers (numerical constants) and 524Numbers (numerical constants) and
525string literals are explained in Section~\ref{lexical}; 525string literals are explained in \See{lexical};
526variables are explained in Section~\ref{assignment}; 526variables are explained in \See{assignment};
527upvalues are explained in Section~\ref{upvalue}; 527upvalues are explained in \See{upvalue};
528function definitions (\M{function}) are explained in Section~\ref{func-def}; 528function definitions (\M{function}) are explained in \See{func-def};
529function call are explained in Section~\ref{functioncall}. 529function call are explained in \See{functioncall}.
530 530
531An access to a global variable \verb|x| is equivalent to a 531An access to a global variable \verb|x| is equivalent to a
532call \verb|getglobal('x')|; 532call \verb|getglobal('x')|;
@@ -549,7 +549,7 @@ the binary \verb|+| (addition),
549\verb|/| (division) and \verb|^| (exponentiation), 549\verb|/| (division) and \verb|^| (exponentiation),
550and unary \verb|-| (negation). 550and unary \verb|-| (negation).
551If the operands are numbers, or strings that can be converted to 551If the operands are numbers, or strings that can be converted to
552numbers, according to the rules given in Section~\ref{coercion}, 552numbers, according to the rules given in \See{coercion},
553then all operations except exponentiation have the usual meaning. 553then all operations except exponentiation have the usual meaning.
554Otherwise, an appropriate tag method is called \see{tag-method}. 554Otherwise, an appropriate tag method is called \see{tag-method}.
555An exponentiation always calls a tag method. 555An exponentiation always calls a tag method.
@@ -571,7 +571,7 @@ Numbers and strings are compared in the usual way.
571Tables, userdata and functions are compared by reference, 571Tables, userdata and functions are compared by reference,
572that is, two tables are considered equal only if they are the same table. 572that is, two tables are considered equal only if they are the same table.
573The operator \verb|~=| is exactly the negation of equality (\verb|==|). 573The operator \verb|~=| is exactly the negation of equality (\verb|==|).
574Note that the conversion rules of Section~\ref{coercion} 574Note that the conversion rules of \See{coercion}
575\emph{do not} apply to equality comparisons. 575\emph{do not} apply to equality comparisons.
576Thus, \verb|"0"==0| evaluates to false. 576Thus, \verb|"0"==0| evaluates to false.
577 577
@@ -602,7 +602,7 @@ the second operand is evaluated only when necessary.
602Lua offers a string \Index{concatenation} operator, 602Lua offers a string \Index{concatenation} operator,
603denoted by ``\IndexVerb{..}''. 603denoted by ``\IndexVerb{..}''.
604If operands are strings or numbers, then they are converted to 604If operands are strings or numbers, then they are converted to
605strings according to the rules in Section~\ref{coercion}. 605strings according to the rules in \See{coercion}.
606Otherwise, the ``concat'' tag method is called \see{tag-method}. 606Otherwise, the ``concat'' tag method is called \see{tag-method}.
607 607
608\subsubsection{Precedence} 608\subsubsection{Precedence}
@@ -1313,7 +1313,7 @@ there is no guarantee that such pointer will be valid after the block ends
1313\verb|lua_getcfunction| converts a \verb|lua_Object| to a C function. 1313\verb|lua_getcfunction| converts a \verb|lua_Object| to a C function.
1314This \verb|lua_Object| must have type \emph{CFunction}; 1314This \verb|lua_Object| must have type \emph{CFunction};
1315otherwise, the function returns 0 (the \verb|NULL| pointer). 1315otherwise, the function returns 0 (the \verb|NULL| pointer).
1316The type \verb|lua_CFunction| is explained in Section~\ref{LuacallC}. 1316The type \verb|lua_CFunction| is explained in \See{LuacallC}.
1317 1317
1318\verb|lua_getuserdata| converts a \verb|lua_Object| to \verb|void*|. 1318\verb|lua_getuserdata| converts a \verb|lua_Object| to \verb|void*|.
1319This \verb|lua_Object| must have type \emph{userdata}; 1319This \verb|lua_Object| must have type \emph{userdata};
@@ -1672,7 +1672,7 @@ For some examples, see files \verb|lstrlib.c|,
1672 1672
1673\subsection{References to Lua Objects} 1673\subsection{References to Lua Objects}
1674 1674
1675As noted in Section~\ref{LuacallC}, \verb|lua_Object|s are volatile. 1675As noted in \See{LuacallC}, \verb|lua_Object|s are volatile.
1676If the C code needs to keep a \verb|lua_Object| 1676If the C code needs to keep a \verb|lua_Object|
1677outside block boundaries, 1677outside block boundaries,
1678then it must create a \Def{reference} to the object. 1678then it must create a \Def{reference} to the object.
@@ -1893,7 +1893,7 @@ and prints their values in a reasonable format.
1893This function is not intended for formatted output, 1893This function is not intended for formatted output,
1894but as a quick way to show a value, 1894but as a quick way to show a value,
1895for instance for error messages or debugging. 1895for instance for error messages or debugging.
1896See Section~\ref{libio} for functions for formatted output. 1896See \See{libio} for functions for formatted output.
1897 1897
1898\subsubsection*{\ff \T{tonumber (e [, base])}}\Deffunc{tonumber} 1898\subsubsection*{\ff \T{tonumber (e [, base])}}\Deffunc{tonumber}
1899This function receives one argument, 1899This function receives one argument,
@@ -2710,27 +2710,30 @@ Here is a list of all these incompatibilities.
2710\subsection*{Incompatibilities with \Index{version 3.0}} 2710\subsection*{Incompatibilities with \Index{version 3.0}}
2711\begin{itemize} 2711\begin{itemize}
2712 2712
2713\item The whole library must be explicitly openen before used. 2713\item To support for multiple contexts,
2714the whole library must be explicitly openen before used.
2714However, all standard libraries check whether Lua is already opened, 2715However, all standard libraries check whether Lua is already opened,
2715so any program that opens at least one standard library before using 2716so any program that opens at least one standard library before using
2716Lua API does not need to be corrected. 2717Lua API does not need to be corrected.
2717 2718
2718\item Function \verb|dostring| does not accept an optional second argument, 2719\item Function \verb|dostring| does not accept an optional second argument,
2719with a temporary error method. 2720with a temporary error method.
2720Now Function \verb|call| offers this facility. 2721This facility is now provided by function \verb|call|.
2721 2722
2722\item Function \verb|gsub| does not accept an optional fourth argument 2723\item Function \verb|gsub| no longer accepts an optional fourth argument
2723(a callback data, a table). 2724(a callback data, a table).
2724Closures make this feature irrelevant. 2725Closures make this feature irrelevant.
2725 2726
2726\item The syntax for function declaration is now more restricted; 2727\item The syntax for function declaration is now more restricted;
2727for instance, the old syntax \verb|function f[exp] (x) ... end| is not 2728for instance, the old syntax \verb|function f[exp] (x) ... end| is not
2728accepted in 3.1. 2729accepted in 3.1.
2729Progams should use an explicit assignment instead. 2730Progams should use an explicit assignment instead, like this:
2731\verb|f[exp] = function (x) ... end|.
2730 2732
2731\item Old pre-compiled code is obsolete, and must be re-compiled. 2733\item Old pre-compiled code is obsolete, and must be re-compiled.
2732 2734
2733\item The option \verb|a=b| in Lua stand-alone does not need extra quotes. 2735\item The option \verb|a=b| in Lua stand-alone does not need extra quotes.
2736Check \See{lua-sa} for details.
2734 2737
2735\end{itemize} 2738\end{itemize}
2736 2739