aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-01-30 10:55:10 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-01-30 10:55:10 -0200
commitb1c02c7f00eeffbb16a87f95ab8ef83116b97bad (patch)
treef79ba5c0639112f588fc93ae8261f0784410b64f
parent84df3ac2675af018d85d26746165325475575965 (diff)
downloadlua-b1c02c7f00eeffbb16a87f95ab8ef83116b97bad.tar.gz
lua-b1c02c7f00eeffbb16a87f95ab8ef83116b97bad.tar.bz2
lua-b1c02c7f00eeffbb16a87f95ab8ef83116b97bad.zip
new fallback "getglobal".
modifications to generate an index (not automatically yet).
-rw-r--r--manual.tex28
1 files changed, 20 insertions, 8 deletions
diff --git a/manual.tex b/manual.tex
index 3420e87e..ceb1e0bb 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: $ 1% $Id: manual.tex,v 1.2 1996/01/29 17:08:23 roberto Exp roberto $
2 2
3\documentstyle[A4,11pt,bnf]{article} 3\documentstyle[A4,11pt,bnf]{article}
4 4
@@ -13,7 +13,7 @@
13\newcommand{\Def}[1]{{\em #1}\index{#1}} 13\newcommand{\Def}[1]{{\em #1}\index{#1}}
14\newcommand{\Deffunc}[1]{\index{{\tt #1}}} 14\newcommand{\Deffunc}[1]{\index{{\tt #1}}}
15 15
16 16%\makeindex
17 17
18\begin{document} 18\begin{document}
19 19
@@ -32,7 +32,7 @@ Waldemar Celes Filho
32Departamento de Inform\'atica --- PUC-Rio 32Departamento de Inform\'atica --- PUC-Rio
33} 33}
34 34
35\date{November, 1995} 35\date{\small \verb$Date: 1996/01/29 17:08:23 $}
36 36
37\maketitle 37\maketitle
38 38
@@ -44,8 +44,6 @@ as a configuration language for any program that needs one.
44This document describes version 2.2 of the Lua programming language and the 44This document describes version 2.2 of the Lua programming language and the
45API that allows interaction between Lua programs and its host C program. 45API that allows interaction between Lua programs and its host C program.
46It also presents some examples of using the main features of the system. 46It also presents some examples of using the main features of the system.
47
48{\em Lua manual: \verb$Date$, \verb$Revision$}
49\end{abstract} 47\end{abstract}
50 48
51\vspace{4ex} 49\vspace{4ex}
@@ -649,6 +647,12 @@ not present in a table.
649It receives as arguments the table and the index. 647It receives as arguments the table and the index.
650Its return value is the final result of the indexing operation. 648Its return value is the final result of the indexing operation.
651The default function returns nil. 649The default function returns nil.
650\item[``getglobal'']\index{index getglobal}
651called when Lua tries to retrieve the value of a global variable
652which has a nil value (or which has not been initialized).
653It receives as argument the name of the variable.
654Its return value is the final result of the expression.
655The default function returns nil.
652\item[``gettable'']\index{gettable fallback} 656\item[``gettable'']\index{gettable fallback}
653called when Lua tries to index a non table value. 657called when Lua tries to index a non table value.
654It receives as arguments the non table value and the index. 658It receives as arguments the non table value and the index.
@@ -751,7 +755,8 @@ executes the ``file'' {\tt stdin}.
751 755
752\subsection{Converting Values between C and Lua} \label{valuesCLua} 756\subsection{Converting Values between C and Lua} \label{valuesCLua}
753Because Lua has no static type system, 757Because Lua has no static type system,
754all values passed between Lua and C have type \IndexVerb{lua\_Object}, 758all values passed between Lua and C have type
759\verb'lua_Object'\Deffunc{lua_Object},
755which works like an abstract type in C that can hold any Lua value. 760which works like an abstract type in C that can hold any Lua value.
756 761
757Lua has automatic memory management, and garbage collection. 762Lua has automatic memory management, and garbage collection.
@@ -832,7 +837,8 @@ otherwise, the function returns 0 (the null pointer).
832The reverse process, that is, passing a specific C value to Lua, 837The reverse process, that is, passing a specific C value to Lua,
833is done by using the following functions: 838is done by using the following functions:
834\Deffunc{lua_pushnumber}\Deffunc{lua_pushstring}\Deffunc{lua_pushliteral} 839\Deffunc{lua_pushnumber}\Deffunc{lua_pushstring}\Deffunc{lua_pushliteral}
835\Deffunc{lua_pushcfunction}\Deffunc{lua_pushusertag}\Deffunc{lua_pushuserdata} 840\Deffunc{lua_pushcfunction}\Deffunc{lua_pushusertag}
841\Deffunc{lua_pushuserdata}
836\begin{verbatim} 842\begin{verbatim}
837void lua_pushnumber (double n); 843void lua_pushnumber (double n);
838void lua_pushstring (char *s); 844void lua_pushstring (char *s);
@@ -1040,7 +1046,8 @@ lua_Object lua_getparam (int number);
1040\end{verbatim} 1046\end{verbatim}
1041where \verb'number' starts with 1 to get the first argument. 1047where \verb'number' starts with 1 to get the first argument.
1042When called with a number larger than the actual number of arguments, 1048When called with a number larger than the actual number of arguments,
1043this function returns \IndexVerb{LUA\_NOOBJECT}. 1049this function returns
1050\verb'LUA_NOOBJECT'\Deffunc{LUA_NOOBJECT}.
1044In this way, it is possible to write functions that work with 1051In this way, it is possible to write functions that work with
1045a variable number of parameters. 1052a variable number of parameters.
1046 1053
@@ -1781,4 +1788,9 @@ Special care should be taken with macros like
1781\verb'lua_getindexed' and \verb'lua_getfield'. 1788\verb'lua_getindexed' and \verb'lua_getfield'.
1782\end{itemize} 1789\end{itemize}
1783 1790
1791\newcommand{\indexentry}[2]{\item {#1} #2}
1792\begin{theindex}
1793\input{manual.idx}
1794\end{theindex}
1795
1784\end{document} 1796\end{document}