aboutsummaryrefslogtreecommitdiff
path: root/manual.tex
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-07-04 19:35:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-07-04 19:35:38 -0300
commitda4dbe65b268a76a10f8294350aba0b239a0fbda (patch)
tree64cf72686fce0e5e1af1bcfb7e42ac0d48650ce5 /manual.tex
parent4321fde2a7059b5d5adcedd4f607f695ea30ff8b (diff)
downloadlua-da4dbe65b268a76a10f8294350aba0b239a0fbda.tar.gz
lua-da4dbe65b268a76a10f8294350aba0b239a0fbda.tar.bz2
lua-da4dbe65b268a76a10f8294350aba0b239a0fbda.zip
new functionality for "format": "%d$...".
Diffstat (limited to 'manual.tex')
-rw-r--r--manual.tex21
1 files changed, 15 insertions, 6 deletions
diff --git a/manual.tex b/manual.tex
index 37b51ba0..19f4e34a 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 2.9 1997/07/01 17:41:34 roberto Exp roberto $ 1% $Id: manual.tex,v 2.10 1997/07/02 17:09: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: 1997/07/01 17:41:34 $} 41\date{\small \verb$Date: 1997/07/02 17:09:48 $}
42 42
43\maketitle 43\maketitle
44 44
@@ -826,8 +826,8 @@ The function not only shows when a tag method is called,
826but also its arguments, its results and the default behavior. 826but also its arguments, its results and the default behavior.
827Please notice that the code shown here is only illustrative; 827Please notice that the code shown here is only illustrative;
828the real behavior is hard coded in the interpreter, 828the real behavior is hard coded in the interpreter,
829and it is much more efficient than this simulation. 829and it is much more efficient than this simulation.
830All functions used in these descriptions 830All functions used in these descriptions
831(\verb|rawgetglobal|, \verb|tonumber|, \verb|call|, etc) 831(\verb|rawgetglobal|, \verb|tonumber|, \verb|call|, etc)
832are described in \See{predefined}. 832are described in \See{predefined}.
833 833
@@ -994,7 +994,7 @@ Notice: the function \verb|getglobal| is pre-defined in Lua \see{predefined}.
994 994
995\item[``setglobal'':]\index{setglobal event} 995\item[``setglobal'':]\index{setglobal event}
996called whenever Lua assigns to a global variable. 996called whenever Lua assigns to a global variable.
997This method cannot be set for numbers, strings, and tables and 997This method cannot be set for numbers, strings, and tables and
998userdata with default tags. 998userdata with default tags.
999\begin{verbatim} 999\begin{verbatim}
1000 function setglobal (varname, newvalue) 1000 function setglobal (varname, newvalue)
@@ -1280,7 +1280,7 @@ returns a reference to the object at the top of the C2lua stack,
1280and pops it. 1280and pops it.
1281 1281
1282As a general rule, all API functions pop from the stack 1282As a general rule, all API functions pop from the stack
1283all elements that they use. 1283all elements that they use.
1284 1284
1285Because userdata are objects, 1285Because userdata are objects,
1286the function \verb|lua_pushusertag| may create a new userdata. 1286the function \verb|lua_pushusertag| may create a new userdata.
@@ -1885,6 +1885,15 @@ will produce the string:
1885 new line" 1885 new line"
1886\end{verbatim} 1886\end{verbatim}
1887 1887
1888Conversions can be applied to the n-th argument in the argument list,
1889rather than the next unused argument.
1890In this case, the conversion character \verb|%| is replaced
1891by the sequence \verb|%d$|, where \verb|d| is a
1892decimal digit in the range [1,9],
1893giving the position of the argument in the argument list.
1894For instance, the call \verb|format("%2$d -> %1$03d", 1, 34)| will
1895result in \verb|"34 -> 001"|.
1896
1888The options \verb|c|, \verb|d|, \verb|E|, \verb|e|, \verb|f|, 1897The options \verb|c|, \verb|d|, \verb|E|, \verb|e|, \verb|f|,
1889\verb|g| \verb|i|, \verb|o|, \verb|u|, \verb|X|, and \verb|x| all 1898\verb|g| \verb|i|, \verb|o|, \verb|u|, \verb|X|, and \verb|x| all
1890expect a number as argument, 1899expect a number as argument,