summaryrefslogtreecommitdiff
path: root/manual.tex
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-04-29 15:50:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-04-29 15:50:08 -0300
commit4fb77c430869e4a6c95fd00cd6a9b9c383d95e71 (patch)
treed2609afd4b55472e5cbdd48b98cc6d44e597e946 /manual.tex
parentbced00ab9efcdc68982b5e3787f277b86ea3cde8 (diff)
downloadlua-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.tex39
1 files changed, 17 insertions, 22 deletions
diff --git a/manual.tex b/manual.tex
index 539385a6..f8496422 100644
--- a/manual.tex
+++ b/manual.tex
@@ -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}
1082typedef int lua_Reference; 1082int lua_ref (int lock);
1083 1083lua_Object lua_getref (int ref);
1084lua_Reference lua_ref (int lock); 1084void lua_pushref (int ref);
1085lua_Object lua_getref (lua_Reference ref); 1085void lua_unref (int ref);
1086void lua_pushref (lua_Reference ref);
1087void lua_unref (lua_Reference ref);
1088\end{verbatim} 1086\end{verbatim}
1089The function \verb'lua_ref' creates a reference 1087The function \verb'lua_ref' creates a reference
1090to the object which is on the top of the stack, 1088to 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}
1127In order to have access to these libraries, 1125In order to have access to these libraries,
1128the host program must call the functions 1126the 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.
1383Unlike the \verb'writeto' operation, 1381Unlike the \verb'writeto' operation,
1384this function does not erase any previous content of the file. 1382this function does not erase any previous content of the file.
1385This function returns 2 if the file already exists,
13861 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.
1484This function replaces functions \verb'date' and \verb'time' from 1480This function replaces functions \verb'date' and \verb'time' from
1485previous Lua versions. 1481previous Lua versions.
1486 1482
1483\subsubsection*{{\tt exit ([code])}}\Deffunc{exit}
1487 1484
1488% \subsubsection*{{\tt debug ()}} 1485This function calls the C function \verb-exit-,
1489% This function, when called, repeatedly presents a prompt \verb'lua_debug> ' 1486with an optional \verb-code-,
1490% in the error output stream (\verb'stderr'), 1487to 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
1853lua_Reference lockedParentName; /* lock index for the string "parent" */ 1845int lockedParentName; /* lock index for the string "parent" */
1854lua_Reference lockedOldIndex; /* previous fallback function */ 1846int lockedOldIndex; /* previous fallback function */
1855 1847
1856void callOldFallback (lua_Object table, lua_Object index) 1848void callOldFallback (lua_Object table, lua_Object index)
1857{ 1849{
@@ -2090,10 +2082,13 @@ Here is a list of all these differences.
2090Functions \verb'date' and \verb'time' (from \verb'iolib') 2082Functions \verb'date' and \verb'time' (from \verb'iolib')
2091have been superseded by the new version of function \verb'date'. 2083have been superseded by the new version of function \verb'date'.
2092\item 2084\item
2085Function \verb'append' (from \verb'iolib') now returns 1 whenever it succeeds,
2086whether the file is new or not.
2087\item
2093Function \verb'int2str' (from \verb'strlib') has been superseded by new 2088Function \verb'int2str' (from \verb'strlib') has been superseded by new
2094function \verb'format', with parameter \verb'"%c"'. 2089function \verb'format', with parameter \verb'"%c"'.
2095\item 2090\item
2096The lock mechanism has been superseded by the reference mechanism. 2091The API lock mechanism has been superseded by the reference mechanism.
2097However, \verb-lua.h- provides compatibility macros, 2092However, \verb-lua.h- provides compatibility macros,
2098so there is no need to change programs. 2093so there is no need to change programs.
2099\item 2094\item