diff options
Diffstat (limited to 'manual.tex')
-rw-r--r-- | manual.tex | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -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} |
1659 | is used to put the C function on C2lua, | 1659 | is used to put the C function on C2lua, |
1660 | with the argument \verb|n| telling how many upvalues must be | 1660 | with the argument \verb|n| telling how many upvalues must be |
1661 | associated with the function | 1661 | associated with the function; |
1662 | (notice that the macro \verb|lua_pushcfunction| is defined as | 1662 | in 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. |
1664 | Then, any time the function is called, | 1664 | Then, any time the function is called, |
1665 | these upvalues are inserted as the first arguments to the function, | 1665 | these upvalues are inserted as the first arguments to the function, |
1666 | before the actual arguments provided in the call. | 1666 | before 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} |
1721 | In order to have access to these libraries, | 1721 | To have access to these libraries, |
1722 | the C host program must call the functions | 1722 | the 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|, |
1724 | declared in \verb|lualib.h|. | 1724 | and \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, |
2712 | the whole library must be explicitly opened before used. | 2713 | Lua 3.1 must be explicitly opened before used. |
2713 | However, all standard libraries check whether Lua is already opened, | 2714 | However, all standard libraries check whether Lua is already opened, |
2714 | so any program that opens at least one standard library before using | 2715 | so any program that opens at least one standard library before using |
2715 | Lua API does not need to be corrected. | 2716 | Lua 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, |
2718 | with a temporary error method. | 2719 | with 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; |
2726 | for instance, the old syntax \verb|function f[exp] (x) ... end| is not | 2727 | for instance, the old syntax \verb|function f[exp] (x) ... end| is not |
2727 | accepted in 3.1. | 2728 | accepted in 3.1. |
2728 | Programs should use an explicit assignment instead, like this: | 2729 | In these cases, |
2730 | programs 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. |