diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-04-29 15:50:08 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-04-29 15:50:08 -0300 |
commit | 4fb77c430869e4a6c95fd00cd6a9b9c383d95e71 (patch) | |
tree | d2609afd4b55472e5cbdd48b98cc6d44e597e946 /manual.tex | |
parent | bced00ab9efcdc68982b5e3787f277b86ea3cde8 (diff) | |
download | lua-4fb77c430869e4a6c95fd00cd6a9b9c383d95e71.tar.gz lua-4fb77c430869e4a6c95fd00cd6a9b9c383d95e71.tar.bz2 lua-4fb77c430869e4a6c95fd00cd6a9b9c383d95e71.zip |
no more "lua_Reference"; new return value for "append";
documentation of "exit" (it was not in the manual).
Diffstat (limited to 'manual.tex')
-rw-r--r-- | manual.tex | 39 |
1 files changed, 17 insertions, 22 deletions
@@ -1,4 +1,4 @@ | |||
1 | % $Id: manual.tex,v 1.15 1996/04/01 14:36:35 roberto Exp roberto $ | 1 | % $Id: manual.tex,v 1.16 1996/04/22 18:00:37 roberto Exp roberto $ |
2 | 2 | ||
3 | \documentstyle[fullpage,11pt,bnf]{article} | 3 | \documentstyle[fullpage,11pt,bnf]{article} |
4 | 4 | ||
@@ -34,7 +34,7 @@ Waldemar Celes Filho | |||
34 | \tecgraf\ --- Departamento de Inform\'atica --- PUC-Rio | 34 | \tecgraf\ --- Departamento de Inform\'atica --- PUC-Rio |
35 | } | 35 | } |
36 | 36 | ||
37 | \date{\small \verb$Date: 1996/04/01 14:36:35 $} | 37 | \date{\small \verb$Date: 1996/04/22 18:00:37 $} |
38 | 38 | ||
39 | \maketitle | 39 | \maketitle |
40 | 40 | ||
@@ -1079,12 +1079,10 @@ The routines to manipulate references are the following: | |||
1079 | \Deffunc{lua_ref}\Deffunc{lua_getref} | 1079 | \Deffunc{lua_ref}\Deffunc{lua_getref} |
1080 | \Deffunc{lua_pushref}\Deffunc{lua_unref} | 1080 | \Deffunc{lua_pushref}\Deffunc{lua_unref} |
1081 | \begin{verbatim} | 1081 | \begin{verbatim} |
1082 | typedef int lua_Reference; | 1082 | int lua_ref (int lock); |
1083 | 1083 | lua_Object lua_getref (int ref); | |
1084 | lua_Reference lua_ref (int lock); | 1084 | void lua_pushref (int ref); |
1085 | lua_Object lua_getref (lua_Reference ref); | 1085 | void lua_unref (int ref); |
1086 | void lua_pushref (lua_Reference ref); | ||
1087 | void lua_unref (lua_Reference ref); | ||
1088 | \end{verbatim} | 1086 | \end{verbatim} |
1089 | The function \verb'lua_ref' creates a reference | 1087 | The function \verb'lua_ref' creates a reference |
1090 | to the object which is on the top of the stack, | 1088 | to the object which is on the top of the stack, |
@@ -1122,7 +1120,7 @@ Currently there are three standard libraries: | |||
1122 | \begin{itemize} | 1120 | \begin{itemize} |
1123 | \item string manipulation; | 1121 | \item string manipulation; |
1124 | \item mathematical functions (sin, cos, etc); | 1122 | \item mathematical functions (sin, cos, etc); |
1125 | \item input and output. | 1123 | \item input and output (plus some system facilities). |
1126 | \end{itemize} | 1124 | \end{itemize} |
1127 | In order to have access to these libraries, | 1125 | In order to have access to these libraries, |
1128 | the host program must call the functions | 1126 | the host program must call the functions |
@@ -1382,8 +1380,6 @@ This function opens a file named \verb'filename' and sets it as the | |||
1382 | {\em current} output file. | 1380 | {\em current} output file. |
1383 | Unlike the \verb'writeto' operation, | 1381 | Unlike the \verb'writeto' operation, |
1384 | this function does not erase any previous content of the file. | 1382 | this function does not erase any previous content of the file. |
1385 | This function returns 2 if the file already exists, | ||
1386 | 1 if it creates a new file, and \nil\ on failure. | ||
1387 | 1383 | ||
1388 | \subsubsection*{{\tt remove (filename)}}\Deffunc{remove} | 1384 | \subsubsection*{{\tt remove (filename)}}\Deffunc{remove} |
1389 | 1385 | ||
@@ -1484,15 +1480,11 @@ it returns a reasonable date and time representation. | |||
1484 | This function replaces functions \verb'date' and \verb'time' from | 1480 | This function replaces functions \verb'date' and \verb'time' from |
1485 | previous Lua versions. | 1481 | previous Lua versions. |
1486 | 1482 | ||
1483 | \subsubsection*{{\tt exit ([code])}}\Deffunc{exit} | ||
1487 | 1484 | ||
1488 | % \subsubsection*{{\tt debug ()}} | 1485 | This function calls the C function \verb-exit-, |
1489 | % This function, when called, repeatedly presents a prompt \verb'lua_debug> ' | 1486 | with an optional \verb-code-, |
1490 | % in the error output stream (\verb'stderr'), | 1487 | to terminate the program. |
1491 | % reads a line from the standard input, | ||
1492 | % and executes (``dostring'') the line. | ||
1493 | % The loop ends when the user types \verb'cont' to the prompt. | ||
1494 | % This function then returns and the execution of the program continues. | ||
1495 | |||
1496 | 1488 | ||
1497 | 1489 | ||
1498 | \section{The Debuger Interface} \label{debugI} | 1490 | \section{The Debuger Interface} \label{debugI} |
@@ -1850,8 +1842,8 @@ as illustrated in Figure~\ref{Cinher}. | |||
1850 | \begin{verbatim} | 1842 | \begin{verbatim} |
1851 | #include "lua.h" | 1843 | #include "lua.h" |
1852 | 1844 | ||
1853 | lua_Reference lockedParentName; /* lock index for the string "parent" */ | 1845 | int lockedParentName; /* lock index for the string "parent" */ |
1854 | lua_Reference lockedOldIndex; /* previous fallback function */ | 1846 | int lockedOldIndex; /* previous fallback function */ |
1855 | 1847 | ||
1856 | void callOldFallback (lua_Object table, lua_Object index) | 1848 | void callOldFallback (lua_Object table, lua_Object index) |
1857 | { | 1849 | { |
@@ -2090,10 +2082,13 @@ Here is a list of all these differences. | |||
2090 | Functions \verb'date' and \verb'time' (from \verb'iolib') | 2082 | Functions \verb'date' and \verb'time' (from \verb'iolib') |
2091 | have been superseded by the new version of function \verb'date'. | 2083 | have been superseded by the new version of function \verb'date'. |
2092 | \item | 2084 | \item |
2085 | Function \verb'append' (from \verb'iolib') now returns 1 whenever it succeeds, | ||
2086 | whether the file is new or not. | ||
2087 | \item | ||
2093 | Function \verb'int2str' (from \verb'strlib') has been superseded by new | 2088 | Function \verb'int2str' (from \verb'strlib') has been superseded by new |
2094 | function \verb'format', with parameter \verb'"%c"'. | 2089 | function \verb'format', with parameter \verb'"%c"'. |
2095 | \item | 2090 | \item |
2096 | The lock mechanism has been superseded by the reference mechanism. | 2091 | The API lock mechanism has been superseded by the reference mechanism. |
2097 | However, \verb-lua.h- provides compatibility macros, | 2092 | However, \verb-lua.h- provides compatibility macros, |
2098 | so there is no need to change programs. | 2093 | so there is no need to change programs. |
2099 | \item | 2094 | \item |