aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-10-31 18:31:38 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-10-31 18:31:38 -0200
commitec9d8308b43cb468261f78fc4da6bd524c347db3 (patch)
treeb72ddb0e026fc5c77a56847bf71664a0d161470e
parentaf59848219abcab589ac174c829102ed8a2adc8d (diff)
downloadlua-ec9d8308b43cb468261f78fc4da6bd524c347db3.tar.gz
lua-ec9d8308b43cb468261f78fc4da6bd524c347db3.tar.bz2
lua-ec9d8308b43cb468261f78fc4da6bd524c347db3.zip
global table is also pseudo-index
-rw-r--r--manual.tex17
1 files changed, 6 insertions, 11 deletions
diff --git a/manual.tex b/manual.tex
index ebd7d3ae..7992baf5 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 1.51 2001/07/24 17:25:03 roberto Exp roberto $ 1% $Id: manual.tex,v 1.53 2001/10/31 18:06:05 roberto Exp roberto $
2 2
3\documentclass[11pt,twoside,draft]{article} 3\documentclass[11pt,twoside,draft]{article}
4\usepackage{fullpage} 4\usepackage{fullpage}
@@ -138,7 +138,7 @@ Waldemar Celes
138\tecgraf\ --- Computer Science Department --- PUC-Rio 138\tecgraf\ --- Computer Science Department --- PUC-Rio
139} 139}
140 140
141%\date{{\small \tt\$Date: 2001/07/24 17:25:03 $ $}} 141%\date{{\small \tt\$Date: 2001/10/31 18:06:05 $ $}}
142 142
143\maketitle 143\maketitle
144 144
@@ -1869,8 +1869,8 @@ any function that accepts valid indices can also be called with
1869which represent some Lua values that are accessible to the C~code 1869which represent some Lua values that are accessible to the C~code
1870but are not in the stack. 1870but are not in the stack.
1871 1871
1872Pseudo-indices are used to access the registry 1872Pseudo-indices are used to access the table of globals \see{globals},
1873and the upvalues of a C function \see{c-closure}. 1873the registry, and the upvalues of a C function \see{c-closure}.
1874 1874
1875\subsection{Stack Manipulation} 1875\subsection{Stack Manipulation}
1876The API offers the following functions for basic stack manipulation: 1876The API offers the following functions for basic stack manipulation:
@@ -2240,7 +2240,7 @@ The compiled chunk is left as a function on top of the stack.
2240The return values are the same as those of 2240The return values are the same as those of
2241\verb|lua_dofile| and \verb|lua_dobuffer|. 2241\verb|lua_dofile| and \verb|lua_dobuffer|.
2242 2242
2243\subsection{Manipulating Global Variables} 2243\subsection{Manipulating Global Variables} \label{globals}
2244 2244
2245To read the value of a global Lua variable, 2245To read the value of a global Lua variable,
2246you call 2246you call
@@ -2275,12 +2275,7 @@ use \verb|lua_rawset| over the table of globals
2275(see below). 2275(see below).
2276 2276
2277All global variables are kept in an ordinary Lua table. 2277All global variables are kept in an ordinary Lua table.
2278You can get this table calling 2278This table is always at pseudo-index \IndexAPI{LUA_GLOBALSINDEX}.
2279\begin{verbatim}
2280 void lua_getglobals (lua_State *L);
2281\end{verbatim}
2282\DefAPI{lua_getglobals}
2283which pushes the current table of globals onto the stack.
2284To set another table as the table of globals, 2279To set another table as the table of globals,
2285you call 2280you call
2286\begin{verbatim} 2281\begin{verbatim}