aboutsummaryrefslogtreecommitdiff
path: root/manual.tex
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-09 12:57:43 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-01-09 12:57:43 -0200
commit6ac047afc46cbee935587b5734ec37d2e667a598 (patch)
tree9dd53dcde6b44b1b2593420a13cbd828261a690e /manual.tex
parent0e1058cfdd07a3751fce1c79b75241cf770266cf (diff)
downloadlua-6ac047afc46cbee935587b5734ec37d2e667a598.tar.gz
lua-6ac047afc46cbee935587b5734ec37d2e667a598.tar.bz2
lua-6ac047afc46cbee935587b5734ec37d2e667a598.zip
details
Diffstat (limited to 'manual.tex')
-rw-r--r--manual.tex26
1 files changed, 14 insertions, 12 deletions
diff --git a/manual.tex b/manual.tex
index 18803118..4139955b 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 1.2 1998/01/06 19:17:31 roberto Exp roberto $ 1% $Id: manual.tex,v 1.3 1998/01/07 16:26:48 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: 1998/01/06 19:17:31 $} 41\date{\small \verb$Date: 1998/01/07 16:26:48 $}
42 42
43\maketitle 43\maketitle
44 44
@@ -1658,9 +1658,9 @@ void lua_pushCclosure (lua_CFunction fn, int n);
1658\end{verbatim} 1658\end{verbatim}
1659is used to put the C function on C2lua, 1659is used to put the C function on C2lua,
1660with the argument \verb|n| telling how many upvalues must be 1660with the argument \verb|n| telling how many upvalues must be
1661associated with the function 1661associated with the function;
1662(notice that the macro \verb|lua_pushcfunction| is defined as 1662in fact, the macro \verb|lua_pushcfunction| is defined as
1663\verb|lua_pushCclosure| with \verb|n| set to 0). 1663\verb|lua_pushCclosure| with \verb|n| set to 0.
1664Then, any time the function is called, 1664Then, any time the function is called,
1665these upvalues are inserted as the first arguments to the function, 1665these upvalues are inserted as the first arguments to the function,
1666before the actual arguments provided in the call. 1666before the actual arguments provided in the call.
@@ -1718,10 +1718,11 @@ Currently there are three standard libraries:
1718\item mathematical functions (sin, log, etc); 1718\item mathematical functions (sin, log, etc);
1719\item input and output (plus some system facilities). 1719\item input and output (plus some system facilities).
1720\end{itemize} 1720\end{itemize}
1721In order to have access to these libraries, 1721To have access to these libraries,
1722the C host program must call the functions 1722the C host program must call the functions
1723\verb|lua_strlibopen|, \verb|lua_mathlibopen|, and \verb|lua_iolibopen|, 1723\verb|lua_strlibopen|, \verb|lua_mathlibopen|,
1724declared in \verb|lualib.h|. 1724and \verb|lua_iolibopen|, declared in \verb|lualib.h|.
1725\Deffunc{lua_strlibopen}\Deffunc{lua_mathlibopen}\Deffunc{lua_iolibopen}.
1725 1726
1726 1727
1727\subsection{Predefined Functions} \label{predefined} 1728\subsection{Predefined Functions} \label{predefined}
@@ -2708,11 +2709,11 @@ Here is a list of all these incompatibilities.
2708\subsection*{Incompatibilities with \Index{version 3.0}} 2709\subsection*{Incompatibilities with \Index{version 3.0}}
2709\begin{itemize} 2710\begin{itemize}
2710 2711
2711\item To support for multiple contexts, 2712\item To support multiple contexts,
2712the whole library must be explicitly opened before used. 2713Lua 3.1 must be explicitly opened before used.
2713However, all standard libraries check whether Lua is already opened, 2714However, all standard libraries check whether Lua is already opened,
2714so any program that opens at least one standard library before using 2715so any program that opens at least one standard library before using
2715Lua API does not need to be corrected. 2716Lua API does not need to be modified.
2716 2717
2717\item Function \verb|dostring| does not accept an optional second argument, 2718\item Function \verb|dostring| does not accept an optional second argument,
2718with a temporary error method. 2719with a temporary error method.
@@ -2725,7 +2726,8 @@ Closures make this feature irrelevant.
2725\item The syntax for function declaration is now more restricted; 2726\item The syntax for function declaration is now more restricted;
2726for instance, the old syntax \verb|function f[exp] (x) ... end| is not 2727for instance, the old syntax \verb|function f[exp] (x) ... end| is not
2727accepted in 3.1. 2728accepted in 3.1.
2728Programs should use an explicit assignment instead, like this: 2729In these cases,
2730programs should use an explicit assignment instead, like
2729\verb|f[exp] = function (x) ... end|. 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.