diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-07-04 19:35:38 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-07-04 19:35:38 -0300 |
| commit | da4dbe65b268a76a10f8294350aba0b239a0fbda (patch) | |
| tree | 64cf72686fce0e5e1af1bcfb7e42ac0d48650ce5 /manual.tex | |
| parent | 4321fde2a7059b5d5adcedd4f607f695ea30ff8b (diff) | |
| download | lua-da4dbe65b268a76a10f8294350aba0b239a0fbda.tar.gz lua-da4dbe65b268a76a10f8294350aba0b239a0fbda.tar.bz2 lua-da4dbe65b268a76a10f8294350aba0b239a0fbda.zip | |
new functionality for "format": "%d$...".
Diffstat (limited to 'manual.tex')
| -rw-r--r-- | manual.tex | 21 |
1 files changed, 15 insertions, 6 deletions
| @@ -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, | |||
| 826 | but also its arguments, its results and the default behavior. | 826 | but also its arguments, its results and the default behavior. |
| 827 | Please notice that the code shown here is only illustrative; | 827 | Please notice that the code shown here is only illustrative; |
| 828 | the real behavior is hard coded in the interpreter, | 828 | the real behavior is hard coded in the interpreter, |
| 829 | and it is much more efficient than this simulation. | 829 | and it is much more efficient than this simulation. |
| 830 | All functions used in these descriptions | 830 | All functions used in these descriptions |
| 831 | (\verb|rawgetglobal|, \verb|tonumber|, \verb|call|, etc) | 831 | (\verb|rawgetglobal|, \verb|tonumber|, \verb|call|, etc) |
| 832 | are described in \See{predefined}. | 832 | are 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} |
| 996 | called whenever Lua assigns to a global variable. | 996 | called whenever Lua assigns to a global variable. |
| 997 | This method cannot be set for numbers, strings, and tables and | 997 | This method cannot be set for numbers, strings, and tables and |
| 998 | userdata with default tags. | 998 | userdata 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, | |||
| 1280 | and pops it. | 1280 | and pops it. |
| 1281 | 1281 | ||
| 1282 | As a general rule, all API functions pop from the stack | 1282 | As a general rule, all API functions pop from the stack |
| 1283 | all elements that they use. | 1283 | all elements that they use. |
| 1284 | 1284 | ||
| 1285 | Because userdata are objects, | 1285 | Because userdata are objects, |
| 1286 | the function \verb|lua_pushusertag| may create a new userdata. | 1286 | the 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 | ||
| 1888 | Conversions can be applied to the n-th argument in the argument list, | ||
| 1889 | rather than the next unused argument. | ||
| 1890 | In this case, the conversion character \verb|%| is replaced | ||
| 1891 | by the sequence \verb|%d$|, where \verb|d| is a | ||
| 1892 | decimal digit in the range [1,9], | ||
| 1893 | giving the position of the argument in the argument list. | ||
| 1894 | For instance, the call \verb|format("%2$d -> %1$03d", 1, 34)| will | ||
| 1895 | result in \verb|"34 -> 001"|. | ||
| 1896 | |||
| 1888 | The options \verb|c|, \verb|d|, \verb|E|, \verb|e|, \verb|f|, | 1897 | The 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 |
| 1890 | expect a number as argument, | 1899 | expect a number as argument, |
