diff options
Diffstat (limited to 'manual.tex')
-rw-r--r-- | manual.tex | 263 |
1 files changed, 132 insertions, 131 deletions
@@ -1,4 +1,4 @@ | |||
1 | % $Id: manual.tex,v 2.7 1997/06/27 18:39:34 roberto Exp roberto $ | 1 | % $Id: manual.tex,v 2.8 1997/06/27 22:38:49 roberto Exp roberto $ |
2 | 2 | ||
3 | \documentstyle[fullpage,11pt,bnf]{article} | 3 | \documentstyle[fullpage,11pt,bnf]{article} |
4 | 4 | ||
@@ -6,14 +6,15 @@ | |||
6 | \newcommand{\See}[1]{Section~\ref{#1}} | 6 | \newcommand{\See}[1]{Section~\ref{#1}} |
7 | \newcommand{\see}[1]{(see \See{#1})} | 7 | \newcommand{\see}[1]{(see \See{#1})} |
8 | \newcommand{\M}[1]{\emph{#1}} | 8 | \newcommand{\M}[1]{\emph{#1}} |
9 | \newcommand{\T}[1]{{\tt #1}} | ||
9 | \newcommand{\Math}[1]{$#1$} | 10 | \newcommand{\Math}[1]{$#1$} |
10 | \newcommand{\nil}{{\bf nil}} | 11 | \newcommand{\nil}{{\bf nil}} |
11 | \newcommand{\Line}{\rule{\linewidth}{.5mm}} | 12 | \newcommand{\Line}{\rule{\linewidth}{.5mm}} |
12 | \def\tecgraf{{\sf TeC\kern-.21em\lower.7ex\hbox{Graf}}} | 13 | \def\tecgraf{{\sf TeC\kern-.21em\lower.7ex\hbox{Graf}}} |
13 | 14 | ||
14 | \newcommand{\Index}[1]{#1\index{#1}} | 15 | \newcommand{\Index}[1]{#1\index{#1}} |
15 | \newcommand{\IndexVerb}[1]{{\tt #1}\index{#1}} | 16 | \newcommand{\IndexVerb}[1]{\T{#1}\index{#1}} |
16 | \newcommand{\Def}[1]{{\em #1}\index{#1}} | 17 | \newcommand{\Def}[1]{\emph{#1}\index{#1}} |
17 | \newcommand{\Deffunc}[1]{\index{#1}} | 18 | \newcommand{\Deffunc}[1]{\index{#1}} |
18 | 19 | ||
19 | \newcommand{\ff}{$\bullet$\ } | 20 | \newcommand{\ff}{$\bullet$\ } |
@@ -38,7 +39,7 @@ Waldemar Celes | |||
38 | \tecgraf\ --- Computer Science Department --- PUC-Rio | 39 | \tecgraf\ --- Computer Science Department --- PUC-Rio |
39 | } | 40 | } |
40 | 41 | ||
41 | \date{\small \verb$Date: 1997/06/27 18:39:34 $} | 42 | \date{\small \verb$Date: 1997/06/27 22:38:49 $} |
42 | 43 | ||
43 | \maketitle | 44 | \maketitle |
44 | 45 | ||
@@ -127,8 +128,8 @@ L.~H.~de Figueiredo. | |||
127 | 128 | ||
128 | Lua is implemented as a library, written in C. | 129 | Lua is implemented as a library, written in C. |
129 | Being an extension language, Lua has no notion of a ``main'' program: | 130 | Being an extension language, Lua has no notion of a ``main'' program: |
130 | it only works {\em embedded\/} in a host client, | 131 | it only works \emph{embedded} in a host client, |
131 | called the {\em embedding\/} program. | 132 | called the \emph{embedding} program. |
132 | This host program can invoke functions to execute a piece of | 133 | This host program can invoke functions to execute a piece of |
133 | code in Lua, can write and read Lua variables, | 134 | code in Lua, can write and read Lua variables, |
134 | and can register C functions to be called by Lua code. | 135 | and can register C functions to be called by Lua code. |
@@ -167,9 +168,9 @@ this default can be changed \see{tag-method}. | |||
167 | 168 | ||
168 | The unit of execution of Lua is called a \Def{chunk}. | 169 | The unit of execution of Lua is called a \Def{chunk}. |
169 | The syntax% | 170 | The syntax% |
170 | \footnote{As usual, \rep{{\em a}} means 0 or more {\em a\/}'s, | 171 | \footnote{As usual, \rep{\emph{a}} means 0 or more \emph{a}'s, |
171 | \opt{{\em a}} means an optional {\em a} and \oneormore{{\em a}} means | 172 | \opt{\emph{a}} means an optional \emph{a} and \oneormore{\emph{a}} means |
172 | one or more {\em a\/}'s.} | 173 | one or more \emph{a}'s.} |
173 | for chunks is: | 174 | for chunks is: |
174 | \begin{Produc} | 175 | \begin{Produc} |
175 | \produc{chunk}{\rep{stat \Or function} \opt{ret}} | 176 | \produc{chunk}{\rep{stat \Or function} \opt{ret}} |
@@ -203,10 +204,10 @@ Besides a type, all values also have a \Index{tag}. | |||
203 | 204 | ||
204 | There are six \Index{basic types} in Lua: \Def{nil}, \Def{number}, | 205 | There are six \Index{basic types} in Lua: \Def{nil}, \Def{number}, |
205 | \Def{string}, \Def{function}, \Def{userdata}, and \Def{table}. | 206 | \Def{string}, \Def{function}, \Def{userdata}, and \Def{table}. |
206 | {\em Nil\/} is the type of the value \nil, | 207 | \emph{Nil} is the type of the value \nil, |
207 | whose main property is to be different from any other value. | 208 | whose main property is to be different from any other value. |
208 | {\em Number\/} represents real (floating-point) numbers, | 209 | \emph{Number} represents real (floating-point) numbers, |
209 | while {\em string\/} has the usual meaning. | 210 | while \emph{string} has the usual meaning. |
210 | The function \verb|type| returns a string describing the type | 211 | The function \verb|type| returns a string describing the type |
211 | of a given value \see{pdf-type}. | 212 | of a given value \see{pdf-type}. |
212 | 213 | ||
@@ -222,15 +223,15 @@ all Lua functions have the same tag, | |||
222 | and all C functions have the same tag, | 223 | and all C functions have the same tag, |
223 | which is different from the tag of a Lua function. | 224 | which is different from the tag of a Lua function. |
224 | 225 | ||
225 | The type {\em userdata\/} is provided to allow | 226 | The type \emph{userdata} is provided to allow |
226 | arbitrary \Index{C pointers} to be stored in Lua variables. | 227 | arbitrary \Index{C pointers} to be stored in Lua variables. |
227 | It corresponds to a \verb|void*| and has no pre-defined operations in Lua, | 228 | It corresponds to a \verb|void*| and has no pre-defined operations in Lua, |
228 | besides assignment and equality test. | 229 | besides assignment and equality test. |
229 | However, by using {\em tag methods}, | 230 | However, by using \emph{tag methods}, |
230 | the programmer may define operations for {\em userdata\/} values | 231 | the programmer may define operations for \emph{userdata} values |
231 | \see{tag-method}. | 232 | \see{tag-method}. |
232 | 233 | ||
233 | The type {\em table\/} implements \Index{associative arrays}, | 234 | The type \emph{table} implements \Index{associative arrays}, |
234 | that is, \Index{arrays} that can be indexed not only with numbers, | 235 | that is, \Index{arrays} that can be indexed not only with numbers, |
235 | but with any value (except \nil). | 236 | but with any value (except \nil). |
236 | Therefore, this type may be used not only to represent ordinary arrays, | 237 | Therefore, this type may be used not only to represent ordinary arrays, |
@@ -245,8 +246,8 @@ The form \verb|t:f(x)| is syntactic sugar for \verb|t.f(t,x)|, | |||
245 | which calls the method \verb|f| from the table \verb|t| passing | 246 | which calls the method \verb|f| from the table \verb|t| passing |
246 | itself as the first parameter \see{func-def}. | 247 | itself as the first parameter \see{func-def}. |
247 | 248 | ||
248 | It is important to notice that tables are {\em objects}, and not values. | 249 | It is important to notice that tables are \emph{objects}, and not values. |
249 | Variables cannot contain tables, only {\em references\/} to them. | 250 | Variables cannot contain tables, only \emph{references} to them. |
250 | Assignment, parameter passing and returns always manipulate references | 251 | Assignment, parameter passing and returns always manipulate references |
251 | to tables, and do not imply any kind of copy. | 252 | to tables, and do not imply any kind of copy. |
252 | Moreover, tables must be explicitly created before used | 253 | Moreover, tables must be explicitly created before used |
@@ -322,16 +323,16 @@ Examples of valid numerical constants are: | |||
322 | All lines that start with a \verb|$| are handled by a pre-processor. | 323 | All lines that start with a \verb|$| are handled by a pre-processor. |
323 | The \verb|$| can be followed by any of the following directives: | 324 | The \verb|$| can be followed by any of the following directives: |
324 | \begin{description} | 325 | \begin{description} |
325 | \item[{\tt debug}] --- turn on some debugging facilities \see{pragma}. | 326 | \item[\T{debug}] --- turn on some debugging facilities \see{pragma}. |
326 | \item[{\tt nodebug}] --- turn off some debugging facilities \see{pragma}. | 327 | \item[\T{nodebug}] --- turn off some debugging facilities \see{pragma}. |
327 | \item[{\tt if \M{cond}}] --- starts a conditional part. | 328 | \item[{\tt if \M{cond}}] --- starts a conditional part. |
328 | If \M{cond} is false, then this part is skipped by the lexical analyzer. | 329 | If \M{cond} is false, then this part is skipped by the lexical analyzer. |
329 | \item[{\tt ifnot \M{cond}}] --- starts a conditional part. | 330 | \item[{\tt ifnot \M{cond}}] --- starts a conditional part. |
330 | If \M{cond} is true, then this part is skipped by the lexical analyzer. | 331 | If \M{cond} is true, then this part is skipped by the lexical analyzer. |
331 | \item[{\tt end}] --- ends a conditional part. | 332 | \item[\T{end}] --- ends a conditional part. |
332 | \item[{\tt else}] --- starts an ``else'' conditional part, | 333 | \item[\T{else}] --- starts an ``else'' conditional part, |
333 | switching the ``skip'' status. | 334 | switching the ``skip'' status. |
334 | \item[{\tt endinput}] --- ends the lexical parse of the file. | 335 | \item[\T{endinput}] --- ends the lexical parse of the file. |
335 | \end{description} | 336 | \end{description} |
336 | 337 | ||
337 | Directives can be freely nested. | 338 | Directives can be freely nested. |
@@ -340,8 +341,8 @@ in that case, even the matching \verb|$end| is not parsed. | |||
340 | 341 | ||
341 | A \M{cond} part may be: | 342 | A \M{cond} part may be: |
342 | \begin{description} | 343 | \begin{description} |
343 | \item[{\tt nil}] --- always false. | 344 | \item[\T{nil}] --- always false. |
344 | \item[{\tt 1}] --- always true. | 345 | \item[\T{1}] --- always true. |
345 | \item[\M{name}] --- true if the value of the | 346 | \item[\M{name}] --- true if the value of the |
346 | global variable \M{name} is different from \nil. | 347 | global variable \M{name} is different from \nil. |
347 | Notice that \M{name} is evaluated before the chunk starts its execution. | 348 | Notice that \M{name} is evaluated before the chunk starts its execution. |
@@ -369,7 +370,7 @@ Functions in Lua can return many values. | |||
369 | Because there are no type declarations, | 370 | Because there are no type declarations, |
370 | the system does not know how many values a function will return, | 371 | the system does not know how many values a function will return, |
371 | or how many parameters it needs. | 372 | or how many parameters it needs. |
372 | Therefore, sometimes, a list of values must be {\em adjusted\/}, at run time, | 373 | Therefore, sometimes, a list of values must be \emph{adjusted}, at run time, |
373 | to a given length. | 374 | to a given length. |
374 | If there are more values than are needed, then the last values are thrown away. | 375 | If there are more values than are needed, then the last values are thrown away. |
375 | If there are more needs than values, then the list is extended with as | 376 | If there are more needs than values, then the list is extended with as |
@@ -416,7 +417,7 @@ Therefore, it can be used to exchange two values, as in | |||
416 | x, y = y, x | 417 | x, y = y, x |
417 | \end{verbatim} | 418 | \end{verbatim} |
418 | The two lists may have different lengths. | 419 | The two lists may have different lengths. |
419 | Before the assignment, the list of values is {\em adjusted\/} to | 420 | Before the assignment, the list of values is \emph{adjusted} to |
420 | the length of the list of variables \see{adjust}. | 421 | the length of the list of variables \see{adjust}. |
421 | 422 | ||
422 | A single name can denote a global or a local variable, | 423 | A single name can denote a global or a local variable, |
@@ -440,7 +441,7 @@ an assignment \verb|t[i] = val| is equivalent to | |||
440 | \verb|settable_event(t, i, val)|. | 441 | \verb|settable_event(t, i, val)|. |
441 | See \See{tag-method} for a description of these functions% | 442 | See \See{tag-method} for a description of these functions% |
442 | \footnote{Function \verb|setglobal| is pre-defined in Lua. | 443 | \footnote{Function \verb|setglobal| is pre-defined in Lua. |
443 | Function {\tt settable\_event} is used only for explanation purposes.}. | 444 | Function \T{settable\_event} is used only for explanatory purposes.}. |
444 | 445 | ||
445 | The syntax \verb|var.NAME| is just syntactic sugar for | 446 | The syntax \verb|var.NAME| is just syntactic sugar for |
446 | \verb|var["NAME"]|: | 447 | \verb|var["NAME"]|: |
@@ -452,7 +453,7 @@ The syntax \verb|var.NAME| is just syntactic sugar for | |||
452 | The \Index{condition expression} of a control structure may return any value. | 453 | The \Index{condition expression} of a control structure may return any value. |
453 | All values different from \nil\ are considered true; | 454 | All values different from \nil\ are considered true; |
454 | only \nil\ is considered false. | 455 | only \nil\ is considered false. |
455 | {\tt if}'s, {\tt while}'s and {\tt repeat}'s have the usual meaning. | 456 | \T{if}'s, \T{while}'s and \T{repeat}'s have the usual meaning. |
456 | 457 | ||
457 | \index{while-do}\index{repeat-until}\index{if-then-else} | 458 | \index{while-do}\index{repeat-until}\index{if-then-else} |
458 | \begin{Produc} | 459 | \begin{Produc} |
@@ -463,7 +464,7 @@ only \nil\ is considered false. | |||
463 | \produc{elseif}{\rwd{elseif} exp1 \rwd{then} block} | 464 | \produc{elseif}{\rwd{elseif} exp1 \rwd{then} block} |
464 | \end{Produc} | 465 | \end{Produc} |
465 | 466 | ||
466 | A {\tt return} is used to return values from a function or a chunk. | 467 | A \T{return} is used to return values from a function or a chunk. |
467 | \label{return} | 468 | \label{return} |
468 | Because they may return more than one value, | 469 | Because they may return more than one value, |
469 | the syntax for a \Index{return statement} is: | 470 | the syntax for a \Index{return statement} is: |
@@ -516,7 +517,7 @@ an access to an indexed variable \verb|t[i]| is equivalent to | |||
516 | a call \verb|gettable_event(t, i)|. | 517 | a call \verb|gettable_event(t, i)|. |
517 | See \See{tag-method} for a description of these functions% | 518 | See \See{tag-method} for a description of these functions% |
518 | \footnote{Function \verb|getglobal| is pre-defined in Lua. | 519 | \footnote{Function \verb|getglobal| is pre-defined in Lua. |
519 | Function {\tt gettable\_event} is used only for explanation purposes.}. | 520 | Function \T{gettable\_event} is used only for explanatory purposes.}. |
520 | 521 | ||
521 | The non-terminal \M{exp1} is used to indicate that the values | 522 | The non-terminal \M{exp1} is used to indicate that the values |
522 | returned by an expression must be adjusted to one single value: | 523 | returned by an expression must be adjusted to one single value: |
@@ -554,7 +555,7 @@ Tables, userdata and functions are compared by reference, | |||
554 | that is, two tables are considered equal only if they are the same table. | 555 | that is, two tables are considered equal only if they are the same table. |
555 | The operator \verb|~=| is exactly the negation of equality (\verb|==|). | 556 | The operator \verb|~=| is exactly the negation of equality (\verb|==|). |
556 | Note that the conversion rules of Section~\ref{coercion} | 557 | Note that the conversion rules of Section~\ref{coercion} |
557 | {\em do not\/} apply to equality comparisons. | 558 | \emph{do not} apply to equality comparisons. |
558 | Thus, \verb|"0"==0| evaluates to false. | 559 | Thus, \verb|"0"==0| evaluates to false. |
559 | 560 | ||
560 | The other operators work as follows. | 561 | The other operators work as follows. |
@@ -620,7 +621,7 @@ The general syntax for constructors is: | |||
620 | \produc{ffieldlist}{\opt{ffieldlist1}} | 621 | \produc{ffieldlist}{\opt{ffieldlist1}} |
621 | \end{Produc} | 622 | \end{Produc} |
622 | 623 | ||
623 | The form {\em lfieldlist1\/} is used to initialize lists. | 624 | The form \emph{lfieldlist1} is used to initialize lists. |
624 | \begin{Produc} | 625 | \begin{Produc} |
625 | \produc{lfieldlist1}{exp \rep{\ter{,} exp} \opt{\ter{,}}} | 626 | \produc{lfieldlist1}{exp \rep{\ter{,} exp} \opt{\ter{,}}} |
626 | \end{Produc}% | 627 | \end{Produc}% |
@@ -639,7 +640,7 @@ is essentially equivalent to: | |||
639 | a = temp | 640 | a = temp |
640 | \end{verbatim} | 641 | \end{verbatim} |
641 | 642 | ||
642 | The form {\em ffieldlist1\/} initializes other fields in a table: | 643 | The form \emph{ffieldlist1} initializes other fields in a table: |
643 | \begin{Produc} | 644 | \begin{Produc} |
644 | \produc{ffieldlist1}{ffield \rep{\ter{,} ffield} \opt{\ter{,}}} | 645 | \produc{ffieldlist1}{ffield \rep{\ter{,} ffield} \opt{\ter{,}}} |
645 | \produc{ffield}{\ter{[} exp \ter{]} \ter {=} exp \Or name \ter{=} exp} | 646 | \produc{ffield}{\ter{[} exp \ter{]} \ter {=} exp \Or name \ter{=} exp} |
@@ -666,7 +667,7 @@ A \Index{function call} has the following syntax: | |||
666 | \produc{functioncall}{var realParams} | 667 | \produc{functioncall}{var realParams} |
667 | \end{Produc}% | 668 | \end{Produc}% |
668 | Here, \M{var} can be any variable (global, local, indexed, etc). | 669 | Here, \M{var} can be any variable (global, local, indexed, etc). |
669 | If its value has type {\em function\/}, | 670 | If its value has type \emph{function}, |
670 | then this function is called. | 671 | then this function is called. |
671 | Otherwise, the ``function'' tag method is called, | 672 | Otherwise, the ``function'' tag method is called, |
672 | having as first parameter the value of \M{var}, | 673 | having as first parameter the value of \M{var}, |
@@ -721,7 +722,7 @@ The syntax for function definition is: | |||
721 | When Lua pre-compiles a chunk, | 722 | When Lua pre-compiles a chunk, |
722 | all its function bodies are pre-compiled, too. | 723 | all its function bodies are pre-compiled, too. |
723 | Then, when Lua ``executes'' the function definition, | 724 | Then, when Lua ``executes'' the function definition, |
724 | its body is stored, with type {\em function}, | 725 | its body is stored, with type \emph{function}, |
725 | into the variable \verb|var|. | 726 | into the variable \verb|var|. |
726 | It is in this sense that | 727 | It is in this sense that |
727 | a function definition is an assignment to a global variable. | 728 | a function definition is an assignment to a global variable. |
@@ -1200,17 +1201,17 @@ there is no guarantee that such pointer will be valid after the block ends | |||
1200 | (see below). | 1201 | (see below). |
1201 | 1202 | ||
1202 | \verb|lua_getcfunction| converts a \verb|lua_Object| to a C function. | 1203 | \verb|lua_getcfunction| converts a \verb|lua_Object| to a C function. |
1203 | This \verb|lua_Object| must have type {\em CFunction\/}; | 1204 | This \verb|lua_Object| must have type \emph{CFunction}; |
1204 | otherwise, the function returns 0 (the \verb|NULL| pointer). | 1205 | otherwise, the function returns 0 (the \verb|NULL| pointer). |
1205 | The type \verb|lua_CFunction| is explained in Section~\ref{LuacallC}. | 1206 | The type \verb|lua_CFunction| is explained in Section~\ref{LuacallC}. |
1206 | 1207 | ||
1207 | \verb|lua_getuserdata| converts a \verb|lua_Object| to \verb|void*|. | 1208 | \verb|lua_getuserdata| converts a \verb|lua_Object| to \verb|void*|. |
1208 | This \verb|lua_Object| must have type {\em userdata\/}; | 1209 | This \verb|lua_Object| must have type \emph{userdata}; |
1209 | otherwise, the function returns 0 (the \verb|NULL| pointer). | 1210 | otherwise, the function returns 0 (the \verb|NULL| pointer). |
1210 | 1211 | ||
1211 | Because Lua has automatic memory management and garbage collection, | 1212 | Because Lua has automatic memory management and garbage collection, |
1212 | a \verb|lua_Object| has a limited scope, | 1213 | a \verb|lua_Object| has a limited scope, |
1213 | and is only valid inside the {\em block\/} where it was created. | 1214 | and is only valid inside the \emph{block} where it was created. |
1214 | A C function called from Lua is a block, | 1215 | A C function called from Lua is a block, |
1215 | and its parameters are valid only until its end. | 1216 | and its parameters are valid only until its end. |
1216 | It is good programming practice to convert Lua objects to C values | 1217 | It is good programming practice to convert Lua objects to C values |
@@ -1352,7 +1353,7 @@ lua_Object lua_getglobal (char *varname); | |||
1352 | As in Lua, this function may trigger a tag method. | 1353 | As in Lua, this function may trigger a tag method. |
1353 | To read the real value of any global variable, | 1354 | To read the real value of any global variable, |
1354 | without invoking any tag method, | 1355 | without invoking any tag method, |
1355 | this function has a {\em raw\/} version: | 1356 | this function has a \emph{raw} version: |
1356 | \Deffunc{lua_rawgetglobal} | 1357 | \Deffunc{lua_rawgetglobal} |
1357 | \begin{verbatim} | 1358 | \begin{verbatim} |
1358 | lua_Object lua_rawgetglobal (char *varname); | 1359 | lua_Object lua_rawgetglobal (char *varname); |
@@ -1367,7 +1368,7 @@ void lua_setglobal (char *varname); | |||
1367 | As in Lua, this function may trigger a tag method. | 1368 | As in Lua, this function may trigger a tag method. |
1368 | To set the real value of any global variable, | 1369 | To set the real value of any global variable, |
1369 | without invoking any tag method, | 1370 | without invoking any tag method, |
1370 | this function has a {\em raw\/} version: | 1371 | this function has a \emph{raw} version: |
1371 | \Deffunc{lua_rawgetglobal} | 1372 | \Deffunc{lua_rawgetglobal} |
1372 | \begin{verbatim} | 1373 | \begin{verbatim} |
1373 | void lua_rawsetglobal (char *varname); | 1374 | void lua_rawsetglobal (char *varname); |
@@ -1384,7 +1385,7 @@ and returns the contents of the table at that index. | |||
1384 | As in Lua, this operation may trigger a tag method. | 1385 | As in Lua, this operation may trigger a tag method. |
1385 | To get the real value of any table index, | 1386 | To get the real value of any table index, |
1386 | without invoking any tag method, | 1387 | without invoking any tag method, |
1387 | this function has a {\em raw\/} version: | 1388 | this function has a \emph{raw} version: |
1388 | \Deffunc{lua_rawgetglobal} | 1389 | \Deffunc{lua_rawgetglobal} |
1389 | \begin{verbatim} | 1390 | \begin{verbatim} |
1390 | lua_Object lua_rawgettable (void); | 1391 | lua_Object lua_rawgettable (void); |
@@ -1401,7 +1402,7 @@ void lua_settable (void); | |||
1401 | Again, the tag method for ``settable'' may be called. | 1402 | Again, the tag method for ``settable'' may be called. |
1402 | To set the real value of any table index, | 1403 | To set the real value of any table index, |
1403 | without invoking any tag method, | 1404 | without invoking any tag method, |
1404 | this function has a {\em raw\/} version: | 1405 | this function has a \emph{raw} version: |
1405 | \Deffunc{lua_rawsettable} | 1406 | \Deffunc{lua_rawsettable} |
1406 | \begin{verbatim} | 1407 | \begin{verbatim} |
1407 | void lua_rawsettable (void); | 1408 | void lua_rawsettable (void); |
@@ -1543,7 +1544,7 @@ void lua_unref (int ref); | |||
1543 | The function \verb|lua_ref| creates a reference | 1544 | The function \verb|lua_ref| creates a reference |
1544 | to the object that is on the top of the stack, | 1545 | to the object that is on the top of the stack, |
1545 | and returns this reference. | 1546 | and returns this reference. |
1546 | If \verb|lock| is true, the object is {\em locked\/}: | 1547 | If \verb|lock| is true, the object is \emph{locked}: |
1547 | this means the object will not be garbage collected. | 1548 | this means the object will not be garbage collected. |
1548 | Notice that an unlocked reference may be garbage collected. | 1549 | Notice that an unlocked reference may be garbage collected. |
1549 | Whenever the referenced object is needed, | 1550 | Whenever the referenced object is needed, |
@@ -1584,7 +1585,7 @@ declared in \verb|lualib.h|. | |||
1584 | 1585 | ||
1585 | \subsection{Predefined Functions} \label{predefined} | 1586 | \subsection{Predefined Functions} \label{predefined} |
1586 | 1587 | ||
1587 | \subsubsection*{\ff {\tt call (func, arg, [retmode])}}\Deffunc{call} | 1588 | \subsubsection*{\ff \T{call (func, arg, [retmode])}}\Deffunc{call} |
1588 | This function calls function \verb|func| with | 1589 | This function calls function \verb|func| with |
1589 | the arguments given by the table \verb|arg|. | 1590 | the arguments given by the table \verb|arg|. |
1590 | The call is equivalent to | 1591 | The call is equivalent to |
@@ -1597,7 +1598,7 @@ then Lua stops getting arguments at the first nil value. | |||
1597 | If \verb|retmode| is absent, | 1598 | If \verb|retmode| is absent, |
1598 | all results from \verb|func| are just returned by the call. | 1599 | all results from \verb|func| are just returned by the call. |
1599 | If \verb|retmode| is equal to \verb|"pack"|, | 1600 | If \verb|retmode| is equal to \verb|"pack"|, |
1600 | the results are {\em packed\/} in a single table.\index{packed results} | 1601 | the results are \emph{packed} in a single table.\index{packed results} |
1601 | That is, \verb|call| returns just one table; | 1602 | That is, \verb|call| returns just one table; |
1602 | at index \verb|n|, the table has the total number of results | 1603 | at index \verb|n|, the table has the total number of results |
1603 | from the call; | 1604 | from the call; |
@@ -1610,7 +1611,7 @@ t = {x=1} | |||
1610 | a = call(next, {t,nil;n=2}, "pack") --> a={"x", 1; n=2} | 1611 | a = call(next, {t,nil;n=2}, "pack") --> a={"x", 1; n=2} |
1611 | \end{verbatim} | 1612 | \end{verbatim} |
1612 | 1613 | ||
1613 | \subsubsection*{\ff {\tt collectgarbage ([limit])}}\Deffunc{collectgarbage} | 1614 | \subsubsection*{\ff \T{collectgarbage ([limit])}}\Deffunc{collectgarbage} |
1614 | Forces a garbage collection cycle. | 1615 | Forces a garbage collection cycle. |
1615 | Returns the number of objects collected. | 1616 | Returns the number of objects collected. |
1616 | An optional argument, \verb|limit|, is a number that | 1617 | An optional argument, \verb|limit|, is a number that |
@@ -1621,7 +1622,7 @@ this limit. | |||
1621 | \verb|collectgarbage| is equivalent to | 1622 | \verb|collectgarbage| is equivalent to |
1622 | the API function \verb|lua_collectgarbage|. | 1623 | the API function \verb|lua_collectgarbage|. |
1623 | 1624 | ||
1624 | \subsubsection*{\ff {\tt dofile (filename)}}\Deffunc{dofile} | 1625 | \subsubsection*{\ff \T{dofile (filename)}}\Deffunc{dofile} |
1625 | This function receives a file name, | 1626 | This function receives a file name, |
1626 | opens it, and executes its contents as a Lua chunk, | 1627 | opens it, and executes its contents as a Lua chunk, |
1627 | or as pre-compiled chunks. | 1628 | or as pre-compiled chunks. |
@@ -1634,7 +1635,7 @@ or a non \nil\ value if the chunk returns no values. | |||
1634 | It issues an error when called with a non string argument. | 1635 | It issues an error when called with a non string argument. |
1635 | \verb|dofile| is equivalent to the API function \verb|lua_dofile|. | 1636 | \verb|dofile| is equivalent to the API function \verb|lua_dofile|. |
1636 | 1637 | ||
1637 | \subsubsection*{\ff {\tt dostring (string [, errmethod])}}\Deffunc{dostring} | 1638 | \subsubsection*{\ff \T{dostring (string [, errmethod])}}\Deffunc{dostring} |
1638 | This function executes a given string as a Lua chunk. | 1639 | This function executes a given string as a Lua chunk. |
1639 | If there is any error executing the string, it returns \nil. | 1640 | If there is any error executing the string, it returns \nil. |
1640 | Otherwise, it returns the values returned by the chunk, | 1641 | Otherwise, it returns the values returned by the chunk, |
@@ -1644,11 +1645,11 @@ while \verb|string| runs. | |||
1644 | As a particular case, if \verb|errmethod| is \nil, | 1645 | As a particular case, if \verb|errmethod| is \nil, |
1645 | no error messages will be issued during the execution of the string. | 1646 | no error messages will be issued during the execution of the string. |
1646 | 1647 | ||
1647 | \subsubsection*{\ff {\tt newtag ()}}\Deffunc{newtag}\label{pdf-newtag} | 1648 | \subsubsection*{\ff \T{newtag ()}}\Deffunc{newtag}\label{pdf-newtag} |
1648 | Returns a new tag. | 1649 | Returns a new tag. |
1649 | \verb|newtag| is equivalent to the API function \verb|lua_newtag|. | 1650 | \verb|newtag| is equivalent to the API function \verb|lua_newtag|. |
1650 | 1651 | ||
1651 | \subsubsection*{\ff {\tt next (table, index)}}\Deffunc{next} | 1652 | \subsubsection*{\ff \T{next (table, index)}}\Deffunc{next} |
1652 | This function allows a program to traverse all fields of a table. | 1653 | This function allows a program to traverse all fields of a table. |
1653 | Its first argument is a table and its second argument | 1654 | Its first argument is a table and its second argument |
1654 | is an index in this table. | 1655 | is an index in this table. |
@@ -1665,7 +1666,7 @@ semantically, there is no difference between a | |||
1665 | field not present in a table or a field with value \nil. | 1666 | field not present in a table or a field with value \nil. |
1666 | Therefore, the function only considers fields with non \nil\ values. | 1667 | Therefore, the function only considers fields with non \nil\ values. |
1667 | The order in which the indices are enumerated is not specified, | 1668 | The order in which the indices are enumerated is not specified, |
1668 | {\em not even for numeric indices} | 1669 | \emph{not even for numeric indices} |
1669 | (to traverse a table in numeric order, | 1670 | (to traverse a table in numeric order, |
1670 | use a counter). | 1671 | use a counter). |
1671 | If the table is modified in any way during a traversal, | 1672 | If the table is modified in any way during a traversal, |
@@ -1673,7 +1674,7 @@ the semantics of \verb|next| is undefined. | |||
1673 | 1674 | ||
1674 | This function cannot be written with the standard API. | 1675 | This function cannot be written with the standard API. |
1675 | 1676 | ||
1676 | \subsubsection*{\ff {\tt nextvar (name)}}\Deffunc{nextvar} | 1677 | \subsubsection*{\ff \T{nextvar (name)}}\Deffunc{nextvar} |
1677 | This function is similar to the function \verb|next|, | 1678 | This function is similar to the function \verb|next|, |
1678 | but iterates over the global variables. | 1679 | but iterates over the global variables. |
1679 | Its single argument is the name of a global variable, | 1680 | Its single argument is the name of a global variable, |
@@ -1686,11 +1687,11 @@ otherwise the semantics of \verb|nextvar| is undefined. | |||
1686 | 1687 | ||
1687 | This function cannot be written with the standard API. | 1688 | This function cannot be written with the standard API. |
1688 | 1689 | ||
1689 | \subsubsection*{\ff {\tt tostring (e)}}\Deffunc{tostring} | 1690 | \subsubsection*{\ff \T{tostring (e)}}\Deffunc{tostring} |
1690 | This function receives an argument of any type and | 1691 | This function receives an argument of any type and |
1691 | converts it to a string in a reasonable format. | 1692 | converts it to a string in a reasonable format. |
1692 | 1693 | ||
1693 | \subsubsection*{\ff {\tt print (e1, e2, ...)}}\Deffunc{print} | 1694 | \subsubsection*{\ff \T{print (e1, e2, ...)}}\Deffunc{print} |
1694 | This function receives any number of arguments, | 1695 | This function receives any number of arguments, |
1695 | and prints their values in a reasonable format. | 1696 | and prints their values in a reasonable format. |
1696 | Each value is printed in a new line. | 1697 | Each value is printed in a new line. |
@@ -1699,14 +1700,14 @@ but as a quick way to show a value, | |||
1699 | for instance for error messages or debugging. | 1700 | for instance for error messages or debugging. |
1700 | See Section~\ref{libio} for functions for formatted output. | 1701 | See Section~\ref{libio} for functions for formatted output. |
1701 | 1702 | ||
1702 | \subsubsection*{\ff {\tt tonumber (e)}}\Deffunc{tonumber} | 1703 | \subsubsection*{\ff \T{tonumber (e)}}\Deffunc{tonumber} |
1703 | This function receives one argument, | 1704 | This function receives one argument, |
1704 | and tries to convert it to a number. | 1705 | and tries to convert it to a number. |
1705 | If the argument is already a number or a string convertible | 1706 | If the argument is already a number or a string convertible |
1706 | to a number \see{coercion}, then it returns that number; | 1707 | to a number \see{coercion}, then it returns that number; |
1707 | otherwise, it returns \nil. | 1708 | otherwise, it returns \nil. |
1708 | 1709 | ||
1709 | \subsubsection*{\ff {\tt type (v)}}\Deffunc{type}\label{pdf-type} | 1710 | \subsubsection*{\ff \T{type (v)}}\Deffunc{type}\label{pdf-type} |
1710 | This function allows Lua to test the type of a value. | 1711 | This function allows Lua to test the type of a value. |
1711 | It receives one argument, and returns its type, coded as a string. | 1712 | It receives one argument, and returns its type, coded as a string. |
1712 | The possible results of this function are | 1713 | The possible results of this function are |
@@ -1718,79 +1719,79 @@ The possible results of this function are | |||
1718 | and \verb|"userdata"|. | 1719 | and \verb|"userdata"|. |
1719 | \verb|type| is equivalent to the API function \verb|lua_type|. | 1720 | \verb|type| is equivalent to the API function \verb|lua_type|. |
1720 | 1721 | ||
1721 | \subsubsection*{\ff {\tt tag (v)}}\Deffunc{tag} | 1722 | \subsubsection*{\ff \T{tag (v)}}\Deffunc{tag} |
1722 | This function allows Lua to test the tag of a value \see{TypesSec}. | 1723 | This function allows Lua to test the tag of a value \see{TypesSec}. |
1723 | It receives one argument, and returns its tag (a number). | 1724 | It receives one argument, and returns its tag (a number). |
1724 | \verb|tag| is equivalent to the API function \verb|lua_tag|. | 1725 | \verb|tag| is equivalent to the API function \verb|lua_tag|. |
1725 | 1726 | ||
1726 | \subsubsection*{\ff {\tt settag (t, tag)}}\Deffunc{settag} | 1727 | \subsubsection*{\ff \T{settag (t, tag)}}\Deffunc{settag} |
1727 | This function sets the tag of a given table \see{TypesSec}. | 1728 | This function sets the tag of a given table \see{TypesSec}. |
1728 | \verb|tag| must be a value created with \verb|newtag| | 1729 | \verb|tag| must be a value created with \verb|newtag| |
1729 | \see{pdf-newtag}. | 1730 | \see{pdf-newtag}. |
1730 | For security reasons, | 1731 | For security reasons, |
1731 | it is impossible to change the tag of a userdata from Lua. | 1732 | it is impossible to change the tag of a userdata from Lua. |
1732 | 1733 | ||
1733 | \subsubsection*{\ff {\tt assert (v)}}\Deffunc{assert} | 1734 | \subsubsection*{\ff \T{assert (v)}}\Deffunc{assert} |
1734 | This function issues an {\em ``assertion failed!''} error | 1735 | This function issues an \emph{``assertion failed!''} error |
1735 | when its argument is \nil. | 1736 | when its argument is \nil. |
1736 | 1737 | ||
1737 | \subsubsection*{\ff {\tt error (message)}}\Deffunc{error}\label{pdf-error} | 1738 | \subsubsection*{\ff \T{error (message)}}\Deffunc{error}\label{pdf-error} |
1738 | This function issues an error message and terminates | 1739 | This function issues an error message and terminates |
1739 | the last called function from the library | 1740 | the last called function from the library |
1740 | (\verb|lua_dofile|, \verb|lua_dostring|, or \verb|lua_callfunction|). | 1741 | (\verb|lua_dofile|, \verb|lua_dostring|, or \verb|lua_callfunction|). |
1741 | It never returns. | 1742 | It never returns. |
1742 | \verb|error| is equivalent to the API function \verb|lua_error|. | 1743 | \verb|error| is equivalent to the API function \verb|lua_error|. |
1743 | 1744 | ||
1744 | \subsubsection*{\ff {\tt rawgettable (table, index)}}\Deffunc{rawgettable} | 1745 | \subsubsection*{\ff \T{rawgettable (table, index)}}\Deffunc{rawgettable} |
1745 | Gets the real value of \verb|table[index]|, | 1746 | Gets the real value of \verb|table[index]|, |
1746 | without invoking any tag method. | 1747 | without invoking any tag method. |
1747 | \verb|table| must be a table, | 1748 | \verb|table| must be a table, |
1748 | and \verb|index| is any value different from \nil. | 1749 | and \verb|index| is any value different from \nil. |
1749 | 1750 | ||
1750 | \subsubsection*{\ff {\tt rawsettable (table, index, value)}}\Deffunc{rawsettable} | 1751 | \subsubsection*{\ff \T{rawsettable (table, index, value)}}\Deffunc{rawsettable} |
1751 | Sets the real value \verb|table[index]=value|, | 1752 | Sets the real value \verb|table[index]=value|, |
1752 | without invoking any tag method. | 1753 | without invoking any tag method. |
1753 | \verb|table| must be a table, | 1754 | \verb|table| must be a table, |
1754 | \verb|index| is any value different from \nil, | 1755 | \verb|index| is any value different from \nil, |
1755 | and \verb|value| is any Lua value. | 1756 | and \verb|value| is any Lua value. |
1756 | 1757 | ||
1757 | \subsubsection*{\ff {\tt rawsetglobal (name, value)}}\Deffunc{rawsetglobal} | 1758 | \subsubsection*{\ff \T{rawsetglobal (name, value)}}\Deffunc{rawsetglobal} |
1758 | This function assigns the given value to a global variable. | 1759 | This function assigns the given value to a global variable. |
1759 | The string \verb|name| does not need to be a syntactically valid variable name. | 1760 | The string \verb|name| does not need to be a syntactically valid variable name. |
1760 | Therefore, this function can set global variables with strange names like | 1761 | Therefore, this function can set global variables with strange names like |
1761 | \verb|"m v 1"| or \verb|34|. | 1762 | \verb|"m v 1"| or \verb|34|. |
1762 | It returns the value of its second argument. | 1763 | It returns the value of its second argument. |
1763 | 1764 | ||
1764 | \subsubsection*{\ff {\tt setglobal (name, value)}}\Deffunc{setglobal} | 1765 | \subsubsection*{\ff \T{setglobal (name, value)}}\Deffunc{setglobal} |
1765 | This function assigns the given value to a global variable, | 1766 | This function assigns the given value to a global variable, |
1766 | or calls a tag method. | 1767 | or calls a tag method. |
1767 | Its full semantics is explained in \See{tag-method}. | 1768 | Its full semantics is explained in \See{tag-method}. |
1768 | 1769 | ||
1769 | \subsubsection*{\ff {\tt rawgetglobal (name)}}\Deffunc{rawgetglobal} | 1770 | \subsubsection*{\ff \T{rawgetglobal (name)}}\Deffunc{rawgetglobal} |
1770 | This function retrieves the value of a global variable. | 1771 | This function retrieves the value of a global variable. |
1771 | The string \verb|name| does not need to be a | 1772 | The string \verb|name| does not need to be a |
1772 | syntactically valid variable name. | 1773 | syntactically valid variable name. |
1773 | 1774 | ||
1774 | \subsubsection*{\ff {\tt getglobal (name)}}\Deffunc{getglobal} | 1775 | \subsubsection*{\ff \T{getglobal (name)}}\Deffunc{getglobal} |
1775 | This function retrieves the value of a global variable, | 1776 | This function retrieves the value of a global variable, |
1776 | or calls a tag method. | 1777 | or calls a tag method. |
1777 | Its full semantics is explained in \See{tag-method}. | 1778 | Its full semantics is explained in \See{tag-method}. |
1778 | 1779 | ||
1779 | \subsubsection*{\ff {\tt seterrormethod (newmethod)}} | 1780 | \subsubsection*{\ff \T{seterrormethod (newmethod)}} |
1780 | \label{pdf-seterrormethod} | 1781 | \label{pdf-seterrormethod} |
1781 | Sets the error handler \see{error}. | 1782 | Sets the error handler \see{error}. |
1782 | \verb|newmethod| must be a function or \nil, | 1783 | \verb|newmethod| must be a function or \nil, |
1783 | in which case the error handler does nothing. | 1784 | in which case the error handler does nothing. |
1784 | Returns the old error handler. | 1785 | Returns the old error handler. |
1785 | 1786 | ||
1786 | \subsubsection*{\ff {\tt settagmethod (tag, event, newmethod)}} | 1787 | \subsubsection*{\ff \T{settagmethod (tag, event, newmethod)}} |
1787 | \Deffunc{settagmethod} | 1788 | \Deffunc{settagmethod} |
1788 | This function sets a new tag method to the given pair \M{<tag, event>}. | 1789 | This function sets a new tag method to the given pair \M{<tag, event>}. |
1789 | It returns the old method. | 1790 | It returns the old method. |
1790 | If \verb|newmethod| is \nil, | 1791 | If \verb|newmethod| is \nil, |
1791 | it restores the default behavior for the given event. | 1792 | it restores the default behavior for the given event. |
1792 | 1793 | ||
1793 | \subsubsection*{\ff {\tt gettagmethod (tag, event)}} | 1794 | \subsubsection*{\ff \T{gettagmethod (tag, event)}} |
1794 | \Deffunc{gettagmethod} | 1795 | \Deffunc{gettagmethod} |
1795 | This function returns the current tag method | 1796 | This function returns the current tag method |
1796 | for a given pair \M{<tag, event>}. | 1797 | for a given pair \M{<tag, event>}. |
@@ -1802,9 +1803,9 @@ such as finding and extracting substrings and pattern matching. | |||
1802 | When indexing a string, the first character is at position~1, | 1803 | When indexing a string, the first character is at position~1, |
1803 | not~0, as in C. | 1804 | not~0, as in C. |
1804 | 1805 | ||
1805 | \subsubsection*{\ff {\tt strfind (str, pattern [, init [, plain]])}} | 1806 | \subsubsection*{\ff \T{strfind (str, pattern [, init [, plain]])}} |
1806 | \Deffunc{strfind} | 1807 | \Deffunc{strfind} |
1807 | This function looks for the first {\em match\/} of | 1808 | This function looks for the first \emph{match} of |
1808 | \verb|pattern| in \verb|str|. | 1809 | \verb|pattern| in \verb|str|. |
1809 | If it finds one, then it returns the indices on \verb|str| | 1810 | If it finds one, then it returns the indices on \verb|str| |
1810 | where this occurrence starts and ends; | 1811 | where this occurrence starts and ends; |
@@ -1818,10 +1819,10 @@ turns off the pattern matching facilities, | |||
1818 | so the function does a plain ``find substring'' operation, | 1819 | so the function does a plain ``find substring'' operation, |
1819 | with no characters in \verb|pattern| being considered ``magic''. | 1820 | with no characters in \verb|pattern| being considered ``magic''. |
1820 | 1821 | ||
1821 | \subsubsection*{\ff {\tt strlen (s)}}\Deffunc{strlen} | 1822 | \subsubsection*{\ff \T{strlen (s)}}\Deffunc{strlen} |
1822 | Receives a string and returns its length. | 1823 | Receives a string and returns its length. |
1823 | 1824 | ||
1824 | \subsubsection*{\ff {\tt strsub (s, i [, j])}}\Deffunc{strsub} | 1825 | \subsubsection*{\ff \T{strsub (s, i [, j])}}\Deffunc{strsub} |
1825 | Returns another string, which is a substring of \verb|s|, | 1826 | Returns another string, which is a substring of \verb|s|, |
1826 | starting at \verb|i| and running until \verb|j|. | 1827 | starting at \verb|i| and running until \verb|j|. |
1827 | If \verb|i| or \verb|j| are negative, | 1828 | If \verb|i| or \verb|j| are negative, |
@@ -1837,25 +1838,25 @@ with length \verb|j|, | |||
1837 | and the call \verb|strsub(s, -i)| returns a suffix of \verb|s| | 1838 | and the call \verb|strsub(s, -i)| returns a suffix of \verb|s| |
1838 | with length \verb|i|. | 1839 | with length \verb|i|. |
1839 | 1840 | ||
1840 | \subsubsection*{\ff {\tt strlower (s)}}\Deffunc{strlower} | 1841 | \subsubsection*{\ff \T{strlower (s)}}\Deffunc{strlower} |
1841 | Receives a string and returns a copy of that string with all | 1842 | Receives a string and returns a copy of that string with all |
1842 | upper case letters changed to lower case. | 1843 | upper case letters changed to lower case. |
1843 | All other characters are left unchanged. | 1844 | All other characters are left unchanged. |
1844 | 1845 | ||
1845 | \subsubsection*{\ff {\tt strupper (s)}}\Deffunc{strupper} | 1846 | \subsubsection*{\ff \T{strupper (s)}}\Deffunc{strupper} |
1846 | Receives a string and returns a copy of that string with all | 1847 | Receives a string and returns a copy of that string with all |
1847 | lower case letters changed to upper case. | 1848 | lower case letters changed to upper case. |
1848 | All other characters are left unchanged. | 1849 | All other characters are left unchanged. |
1849 | 1850 | ||
1850 | \subsubsection*{\ff {\tt strrep (s, n)}}\Deffunc{strrep} | 1851 | \subsubsection*{\ff \T{strrep (s, n)}}\Deffunc{strrep} |
1851 | Returns a string which is the concatenation of \verb|n| copies of | 1852 | Returns a string which is the concatenation of \verb|n| copies of |
1852 | the string \verb|s|. | 1853 | the string \verb|s|. |
1853 | 1854 | ||
1854 | \subsubsection*{\ff {\tt ascii (s [, i])}}\Deffunc{ascii} | 1855 | \subsubsection*{\ff \T{ascii (s [, i])}}\Deffunc{ascii} |
1855 | Returns the ASCII code of the character \verb|s[i]|. | 1856 | Returns the ASCII code of the character \verb|s[i]|. |
1856 | If \verb|i| is absent, then it is assumed to be 1. | 1857 | If \verb|i| is absent, then it is assumed to be 1. |
1857 | 1858 | ||
1858 | \subsubsection*{\ff {\tt format (formatstring, e1, e2, \ldots)}}\Deffunc{format} | 1859 | \subsubsection*{\ff \T{format (formatstring, e1, e2, \ldots)}}\Deffunc{format} |
1859 | \label{format} | 1860 | \label{format} |
1860 | This function returns a formated version of its variable number of arguments | 1861 | This function returns a formated version of its variable number of arguments |
1861 | following the description given in its first argument (which must be a string). | 1862 | following the description given in its first argument (which must be a string). |
@@ -1890,7 +1891,7 @@ the appropriate format string. | |||
1890 | For example, \verb|"%*g"| can be simulated with | 1891 | For example, \verb|"%*g"| can be simulated with |
1891 | \verb|"%"..width.."g"|. | 1892 | \verb|"%"..width.."g"|. |
1892 | 1893 | ||
1893 | \subsubsection*{\ff {\tt gsub (s, pat, repl [, table] [, n])}} | 1894 | \subsubsection*{\ff \T{gsub (s, pat, repl [, table] [, n])}} |
1894 | \Deffunc{gsub} | 1895 | \Deffunc{gsub} |
1895 | Returns a copy of \verb|s|, | 1896 | Returns a copy of \verb|s|, |
1896 | where all occurrences of the pattern \verb|pat| have been | 1897 | where all occurrences of the pattern \verb|pat| have been |
@@ -1951,25 +1952,25 @@ See some examples below: | |||
1951 | a \Def{character class} is used to represent a set of characters. | 1952 | a \Def{character class} is used to represent a set of characters. |
1952 | The following combinations are allowed in describing a character class: | 1953 | The following combinations are allowed in describing a character class: |
1953 | \begin{description} | 1954 | \begin{description} |
1954 | \item[{\em x}] (where {\em x} is any character not in the list \verb|()%.[*-?|) | 1955 | \item[\emph{x}] (where \emph{x} is any character not in the list \verb|()%.[*-?|) |
1955 | --- represents the character {\em x} itself. | 1956 | --- represents the character \emph{x} itself. |
1956 | \item[{\tt .}] --- represents all characters. | 1957 | \item[\T{.}] --- represents all characters. |
1957 | \item[{\tt \%a}] --- represents all letters. | 1958 | \item[\T{\%a}] --- represents all letters. |
1958 | \item[{\tt \%A}] --- represents all non letter characters. | 1959 | \item[\T{\%A}] --- represents all non letter characters. |
1959 | \item[{\tt \%d}] --- represents all digits. | 1960 | \item[\T{\%d}] --- represents all digits. |
1960 | \item[{\tt \%D}] --- represents all non digits. | 1961 | \item[\T{\%D}] --- represents all non digits. |
1961 | \item[{\tt \%l}] --- represents all lower case letters. | 1962 | \item[\T{\%l}] --- represents all lower case letters. |
1962 | \item[{\tt \%L}] --- represents all non lower case letter characters. | 1963 | \item[\T{\%L}] --- represents all non lower case letter characters. |
1963 | \item[{\tt \%s}] --- represents all space characters. | 1964 | \item[\T{\%s}] --- represents all space characters. |
1964 | \item[{\tt \%S}] --- represents all non space characters. | 1965 | \item[\T{\%S}] --- represents all non space characters. |
1965 | \item[{\tt \%u}] --- represents all upper case letters. | 1966 | \item[\T{\%u}] --- represents all upper case letters. |
1966 | \item[{\tt \%U}] --- represents all non upper case letter characters. | 1967 | \item[\T{\%U}] --- represents all non upper case letter characters. |
1967 | \item[{\tt \%w}] --- represents all alphanumeric characters. | 1968 | \item[\T{\%w}] --- represents all alphanumeric characters. |
1968 | \item[{\tt \%W}] --- represents all non alphanumeric characters. | 1969 | \item[\T{\%W}] --- represents all non alphanumeric characters. |
1969 | \item[{\tt \%\M{x}}] (where \M{x} is any non alphanumeric character) --- | 1970 | \item[{\tt \%\M{x}}] (where \M{x} is any non alphanumeric character) --- |
1970 | represents the character \M{x}. | 1971 | represents the character \M{x}. |
1971 | This is the standard way to escape the magic characters \verb|()%.[*-?|. | 1972 | This is the standard way to escape the magic characters \verb|()%.[*-?|. |
1972 | \item[{\tt [char-set]}] --- | 1973 | \item[\T{[char-set]}] --- |
1973 | Represents the class which is the union of all | 1974 | Represents the class which is the union of all |
1974 | characters in char-set. | 1975 | characters in char-set. |
1975 | To include a \verb|]| in char-set, it must be the first character. | 1976 | To include a \verb|]| in char-set, it must be the first character. |
@@ -1978,7 +1979,7 @@ separating the end characters of the range with a \verb|-|; | |||
1978 | e.g., \verb|A-Z| specifies the upper case characters. | 1979 | e.g., \verb|A-Z| specifies the upper case characters. |
1979 | If \verb|-| appears as the first or last character of char-set, | 1980 | If \verb|-| appears as the first or last character of char-set, |
1980 | then it represents itself. | 1981 | then it represents itself. |
1981 | All classes \verb|%|{\em x} described above can also be used as | 1982 | All classes \verb|%|\emph{x} described above can also be used as |
1982 | components in a char-set. | 1983 | components in a char-set. |
1983 | All other characters in char-set represent themselves. | 1984 | All other characters in char-set represent themselves. |
1984 | \item[{\tt [\^{ }char-set]}] --- | 1985 | \item[{\tt [\^{ }char-set]}] --- |
@@ -2011,7 +2012,7 @@ such item matches a sub-string equal to the n-th captured string | |||
2011 | \item | 2012 | \item |
2012 | {\tt \%b\M{xy}}, where \M{x} and \M{y} are two distinct characters; | 2013 | {\tt \%b\M{xy}}, where \M{x} and \M{y} are two distinct characters; |
2013 | such item matches strings that start with \M{x}, end with \M{y}, | 2014 | such item matches strings that start with \M{x}, end with \M{y}, |
2014 | and where the \M{x} and \M{y} are {\em balanced}. | 2015 | and where the \M{x} and \M{y} are \emph{balanced}. |
2015 | That means that, if one reads the string from left to write, | 2016 | That means that, if one reads the string from left to write, |
2016 | counting plus 1 for an \M{x} and minus 1 for a \M{y}, | 2017 | counting plus 1 for an \M{x} and minus 1 for a \M{y}, |
2017 | the ending \M{y} is the first where the count reaches 0. | 2018 | the ending \M{y} is the first where the count reaches 0. |
@@ -2030,7 +2031,7 @@ end of the subject string. | |||
2030 | a pattern may contain sub-patterns enclosed in parentheses, | 2031 | a pattern may contain sub-patterns enclosed in parentheses, |
2031 | that describe \Def{captures}. | 2032 | that describe \Def{captures}. |
2032 | When a match succeeds, the sub-strings of the subject string | 2033 | When a match succeeds, the sub-strings of the subject string |
2033 | that match captures are stored ({\em captured\/}) for future use. | 2034 | that match captures are stored (\emph{captured}) for future use. |
2034 | Captures are numbered according to their left parentheses. | 2035 | Captures are numbered according to their left parentheses. |
2035 | For instance, in the pattern \verb|"(a*(.)%w(%s*))"|, | 2036 | For instance, in the pattern \verb|"(a*(.)%w(%s*))"|, |
2036 | the part of the string matching \verb|"a*(.)%w(%s*)"| is | 2037 | the part of the string matching \verb|"a*(.)%w(%s*)"| is |
@@ -2057,7 +2058,7 @@ max min mod sin sqrt tan random randomseed | |||
2057 | Most of them | 2058 | Most of them |
2058 | are only interfaces to the homonymous functions in the C library, | 2059 | are only interfaces to the homonymous functions in the C library, |
2059 | except that, for the trigonometric functions, | 2060 | except that, for the trigonometric functions, |
2060 | all angles are expressed in {\em degrees}, not radians. | 2061 | all angles are expressed in \emph{degrees}, not radians. |
2061 | 2062 | ||
2062 | The function \verb|max| returns the maximum | 2063 | The function \verb|max| returns the maximum |
2063 | value of its numeric arguments. | 2064 | value of its numeric arguments. |
@@ -2093,7 +2094,7 @@ Unless otherwise stated, | |||
2093 | all I/O functions return \nil\ on failure and | 2094 | all I/O functions return \nil\ on failure and |
2094 | some value different from \nil\ on success. | 2095 | some value different from \nil\ on success. |
2095 | 2096 | ||
2096 | \subsubsection*{\ff {\tt readfrom (filename)}}\Deffunc{readfrom} | 2097 | \subsubsection*{\ff \T{readfrom (filename)}}\Deffunc{readfrom} |
2097 | 2098 | ||
2098 | This function may be called in two ways. | 2099 | This function may be called in two ways. |
2099 | When called with a file name, it opens the named file, | 2100 | When called with a file name, it opens the named file, |
@@ -2111,7 +2112,7 @@ plus a string describing the error. | |||
2111 | 2112 | ||
2112 | \begin{quotation} | 2113 | \begin{quotation} |
2113 | \noindent | 2114 | \noindent |
2114 | {\em System dependent\/}: if \verb|filename| starts with a \verb-|-, | 2115 | \emph{System dependent}: if \verb|filename| starts with a \verb-|-, |
2115 | then a \Index{piped input} is open, via function \IndexVerb{popen}. | 2116 | then a \Index{piped input} is open, via function \IndexVerb{popen}. |
2116 | Not all systems implement pipes. | 2117 | Not all systems implement pipes. |
2117 | Moreover, | 2118 | Moreover, |
@@ -2119,7 +2120,7 @@ the number of files that can be open at the same time is | |||
2119 | usually limited and depends on the system. | 2120 | usually limited and depends on the system. |
2120 | \end{quotation} | 2121 | \end{quotation} |
2121 | 2122 | ||
2122 | \subsubsection*{\ff {\tt writeto (filename)}}\Deffunc{writeto} | 2123 | \subsubsection*{\ff \T{writeto (filename)}}\Deffunc{writeto} |
2123 | 2124 | ||
2124 | This function may be called in two ways. | 2125 | This function may be called in two ways. |
2125 | When called with a file name, | 2126 | When called with a file name, |
@@ -2128,7 +2129,7 @@ sets its handle as the value of \verb|_OUTPUT|, | |||
2128 | and returns this value. | 2129 | and returns this value. |
2129 | It does not close the current output file. | 2130 | It does not close the current output file. |
2130 | Notice that, if the file already exists, | 2131 | Notice that, if the file already exists, |
2131 | then it will be {\em completely erased\/} with this operation. | 2132 | then it will be \emph{completely erased} with this operation. |
2132 | %When called with a file handle returned by a previous call, | 2133 | %When called with a file handle returned by a previous call, |
2133 | %it restores the file as the current output. | 2134 | %it restores the file as the current output. |
2134 | When called without parameters, | 2135 | When called without parameters, |
@@ -2141,7 +2142,7 @@ plus a string describing the error. | |||
2141 | 2142 | ||
2142 | \begin{quotation} | 2143 | \begin{quotation} |
2143 | \noindent | 2144 | \noindent |
2144 | {\em System dependent\/}: if \verb|filename| starts with a \verb-|-, | 2145 | \emph{System dependent}: if \verb|filename| starts with a \verb-|-, |
2145 | then a \Index{piped output} is open, via function \IndexVerb{popen}. | 2146 | then a \Index{piped output} is open, via function \IndexVerb{popen}. |
2146 | Not all systems implement pipes. | 2147 | Not all systems implement pipes. |
2147 | Moreover, | 2148 | Moreover, |
@@ -2149,7 +2150,7 @@ the number of files that can be open at the same time is | |||
2149 | usually limited and depends on the system. | 2150 | usually limited and depends on the system. |
2150 | \end{quotation} | 2151 | \end{quotation} |
2151 | 2152 | ||
2152 | \subsubsection*{\ff {\tt appendto (filename)}}\Deffunc{appendto} | 2153 | \subsubsection*{\ff \T{appendto (filename)}}\Deffunc{appendto} |
2153 | 2154 | ||
2154 | This function opens a file named \verb|filename| and sets it as the | 2155 | This function opens a file named \verb|filename| and sets it as the |
2155 | value of \verb|_OUTPUT|. | 2156 | value of \verb|_OUTPUT|. |
@@ -2160,25 +2161,25 @@ plus a string describing the error. | |||
2160 | 2161 | ||
2161 | Notice that function \verb|writeto| is available to close an output file. | 2162 | Notice that function \verb|writeto| is available to close an output file. |
2162 | 2163 | ||
2163 | \subsubsection*{\ff {\tt remove (filename)}}\Deffunc{remove} | 2164 | \subsubsection*{\ff \T{remove (filename)}}\Deffunc{remove} |
2164 | 2165 | ||
2165 | This function deletes the file with the given name. | 2166 | This function deletes the file with the given name. |
2166 | If this function fails, it returns \nil, | 2167 | If this function fails, it returns \nil, |
2167 | plus a string describing the error. | 2168 | plus a string describing the error. |
2168 | 2169 | ||
2169 | \subsubsection*{\ff {\tt rename (name1, name2)}}\Deffunc{rename} | 2170 | \subsubsection*{\ff \T{rename (name1, name2)}}\Deffunc{rename} |
2170 | 2171 | ||
2171 | This function renames file named \verb|name1| to \verb|name2|. | 2172 | This function renames file named \verb|name1| to \verb|name2|. |
2172 | If this function fails, it returns \nil, | 2173 | If this function fails, it returns \nil, |
2173 | plus a string describing the error. | 2174 | plus a string describing the error. |
2174 | 2175 | ||
2175 | \subsubsection*{\ff {\tt tmpname ()}}\Deffunc{tmpname} | 2176 | \subsubsection*{\ff \T{tmpname ()}}\Deffunc{tmpname} |
2176 | 2177 | ||
2177 | This function returns a string with a file name that can safely | 2178 | This function returns a string with a file name that can safely |
2178 | be used for a temporary file. | 2179 | be used for a temporary file. |
2179 | The file must be explicitly removed when no longer needed. | 2180 | The file must be explicitly removed when no longer needed. |
2180 | 2181 | ||
2181 | \subsubsection*{\ff {\tt read ([readpattern])}}\Deffunc{read} | 2182 | \subsubsection*{\ff \T{read ([readpattern])}}\Deffunc{read} |
2182 | 2183 | ||
2183 | This function reads the file \verb|_INPUT| | 2184 | This function reads the file \verb|_INPUT| |
2184 | according to a read pattern, that specifies how much to read; | 2185 | according to a read pattern, that specifies how much to read; |
@@ -2186,7 +2187,7 @@ characters are read from the current input file until | |||
2186 | the read pattern fails or ends. | 2187 | the read pattern fails or ends. |
2187 | The function \verb|read| returns a string with the characters read, | 2188 | The function \verb|read| returns a string with the characters read, |
2188 | even if the pattern succeeds only partially, | 2189 | even if the pattern succeeds only partially, |
2189 | or \nil\ if the read pattern fails {\em and\/} | 2190 | or \nil\ if the read pattern fails \emph{and} |
2190 | the result string would be empty. | 2191 | the result string would be empty. |
2191 | When called without parameters, | 2192 | When called without parameters, |
2192 | it uses a default pattern that reads the next line | 2193 | it uses a default pattern that reads the next line |
@@ -2206,7 +2207,7 @@ since it can match a sequence of zero characters, it never fails.% | |||
2206 | \footnote{ | 2207 | \footnote{ |
2207 | Notice that the behavior of read patterns is different from | 2208 | Notice that the behavior of read patterns is different from |
2208 | the regular pattern matching behavior, | 2209 | the regular pattern matching behavior, |
2209 | where a \verb|*| expands to the maximum length {\em such that\/} | 2210 | where a \verb|*| expands to the maximum length \emph{such that} |
2210 | the rest of the pattern does not fail. | 2211 | the rest of the pattern does not fail. |
2211 | With the read pattern behavior | 2212 | With the read pattern behavior |
2212 | there is no need for backtracking the reading. | 2213 | there is no need for backtracking the reading. |
@@ -2232,7 +2233,7 @@ or \nil\ on end of file. | |||
2232 | or \nil\ if the next characters do not conform to an integer format. | 2233 | or \nil\ if the next characters do not conform to an integer format. |
2233 | \end{itemize} | 2234 | \end{itemize} |
2234 | 2235 | ||
2235 | \subsubsection*{\ff {\tt write (value1, ...)}}\Deffunc{write} | 2236 | \subsubsection*{\ff \T{write (value1, ...)}}\Deffunc{write} |
2236 | 2237 | ||
2237 | This function writes the value of each of its arguments to the | 2238 | This function writes the value of each of its arguments to the |
2238 | file \verb|_OUTPUT|. | 2239 | file \verb|_OUTPUT|. |
@@ -2242,7 +2243,7 @@ use \verb|tostring| or \verb|format| before \verb|write|. | |||
2242 | If this function fails, it returns \nil, | 2243 | If this function fails, it returns \nil, |
2243 | plus a string describing the error. | 2244 | plus a string describing the error. |
2244 | 2245 | ||
2245 | \subsubsection*{\ff {\tt date ([format])}}\Deffunc{date} | 2246 | \subsubsection*{\ff \T{date ([format])}}\Deffunc{date} |
2246 | 2247 | ||
2247 | This function returns a string containing date and time | 2248 | This function returns a string containing date and time |
2248 | formatted according to the given string \verb|format|, | 2249 | formatted according to the given string \verb|format|, |
@@ -2251,19 +2252,19 @@ When called without arguments, | |||
2251 | it returns a reasonable date and time representation that depends on | 2252 | it returns a reasonable date and time representation that depends on |
2252 | the host system. | 2253 | the host system. |
2253 | 2254 | ||
2254 | \subsubsection*{\ff {\tt exit ([code])}}\Deffunc{exit} | 2255 | \subsubsection*{\ff \T{exit ([code])}}\Deffunc{exit} |
2255 | 2256 | ||
2256 | This function calls the C function \verb|exit|, | 2257 | This function calls the C function \verb|exit|, |
2257 | with an optional \verb|code|, | 2258 | with an optional \verb|code|, |
2258 | to terminate the program. | 2259 | to terminate the program. |
2259 | The default value for \verb|code| is 1. | 2260 | The default value for \verb|code| is 1. |
2260 | 2261 | ||
2261 | \subsubsection*{\ff {\tt getenv (varname)}}\Deffunc{getenv} | 2262 | \subsubsection*{\ff \T{getenv (varname)}}\Deffunc{getenv} |
2262 | 2263 | ||
2263 | Returns the value of the environment variable \verb|varname|, | 2264 | Returns the value of the environment variable \verb|varname|, |
2264 | or \nil\ if the variable is not defined. | 2265 | or \nil\ if the variable is not defined. |
2265 | 2266 | ||
2266 | \subsubsection*{\ff {\tt execute (command)}}\Deffunc{execute} | 2267 | \subsubsection*{\ff \T{execute (command)}}\Deffunc{execute} |
2267 | 2268 | ||
2268 | This function is equivalent to the C function \verb|system|. | 2269 | This function is equivalent to the C function \verb|system|. |
2269 | It passes \verb|command| to be executed by an operating system shell. | 2270 | It passes \verb|command| to be executed by an operating system shell. |
@@ -2274,7 +2275,7 @@ It returns an error code, which is system-dependent. | |||
2274 | 2275 | ||
2275 | Lua has no built-in debugging facilities. | 2276 | Lua has no built-in debugging facilities. |
2276 | Instead, it offers a special interface, | 2277 | Instead, it offers a special interface, |
2277 | by means of functions and {\em hooks}, | 2278 | by means of functions and \emph{hooks}, |
2278 | which allows the construction of different | 2279 | which allows the construction of different |
2279 | kinds of debuggers, profilers, and other tools | 2280 | kinds of debuggers, profilers, and other tools |
2280 | that need ``inside information'' from the interpreter. | 2281 | that need ``inside information'' from the interpreter. |
@@ -2287,7 +2288,7 @@ is | |||
2287 | \begin{verbatim} | 2288 | \begin{verbatim} |
2288 | lua_Function lua_stackedfunction (int level); | 2289 | lua_Function lua_stackedfunction (int level); |
2289 | \end{verbatim} | 2290 | \end{verbatim} |
2290 | It returns a handle (\verb|lua_Function|) to the {\em activation record\/} | 2291 | It returns a handle (\verb|lua_Function|) to the \emph{activation record} |
2291 | of the function executing at a given level. | 2292 | of the function executing at a given level. |
2292 | Level~0 is the current running function, | 2293 | Level~0 is the current running function, |
2293 | while level \Math{n+1} is the function that has called level \Math{n}. | 2294 | while level \Math{n+1} is the function that has called level \Math{n}. |
@@ -2409,12 +2410,12 @@ called simply \verb|lua|, | |||
2409 | is provided with the standard distribution. | 2410 | is provided with the standard distribution. |
2410 | This program can be called with any sequence of the following arguments: | 2411 | This program can be called with any sequence of the following arguments: |
2411 | \begin{description} | 2412 | \begin{description} |
2412 | \item[{\tt -v}] prints version information. | 2413 | \item[\T{-v}] prints version information. |
2413 | \item[{\tt -}] runs interactively, accepting commands from standard input | 2414 | \item[\T{-}] runs interactively, accepting commands from standard input |
2414 | until an \verb|EOF|. | 2415 | until an \verb|EOF|. |
2415 | \item[{\tt -e stat}] executes \verb|stat| as a Lua chunk. | 2416 | \item[\T{-e stat}] executes \verb|stat| as a Lua chunk. |
2416 | \item[{\tt var=exp}] executes \verb|var=exp| as a Lua chunk. | 2417 | \item[\T{var=exp}] executes \verb|var=exp| as a Lua chunk. |
2417 | \item[{\tt filename}] executes file \verb|filename| as a Lua chunk. | 2418 | \item[\T{filename}] executes file \verb|filename| as a Lua chunk. |
2418 | \end{description} | 2419 | \end{description} |
2419 | All arguments are handled in order. | 2420 | All arguments are handled in order. |
2420 | For instance, an invocation like | 2421 | For instance, an invocation like |
@@ -2431,7 +2432,7 @@ For instance, a call like | |||
2431 | \begin{verbatim} | 2432 | \begin{verbatim} |
2432 | $ lua a="name" prog.lua | 2433 | $ lua a="name" prog.lua |
2433 | \end{verbatim} | 2434 | \end{verbatim} |
2434 | will {\em not\/} set \verb|a| to the string \verb|"name"|. | 2435 | will \emph{not} set \verb|a| to the string \verb|"name"|. |
2435 | Instead, the quotes will be handled by the shell, | 2436 | Instead, the quotes will be handled by the shell, |
2436 | lua will get only \verb|a=name| to run, | 2437 | lua will get only \verb|a=name| to run, |
2437 | and \verb|a| will finish with \nil, | 2438 | and \verb|a| will finish with \nil, |
@@ -2448,7 +2449,7 @@ jointly with \tecgraf, used extensively early versions of | |||
2448 | this system and gave valuable comments. | 2449 | this system and gave valuable comments. |
2449 | The authors would also like to thank Carlos Henrique Levy, | 2450 | The authors would also like to thank Carlos Henrique Levy, |
2450 | who found the name of the game. | 2451 | who found the name of the game. |
2451 | Lua means {\em moon\/} in Portuguese. | 2452 | Lua means \emph{moon} in Portuguese. |
2452 | 2453 | ||
2453 | 2454 | ||
2454 | 2455 | ||
@@ -2494,7 +2495,7 @@ The incompatibilities between the new and the old libraries are: | |||
2494 | \item The format facility of function \verb|write| has been supersed by | 2495 | \item The format facility of function \verb|write| has been supersed by |
2495 | function \verb|format|; | 2496 | function \verb|format|; |
2496 | therefore this facility has been dropped. | 2497 | therefore this facility has been dropped. |
2497 | \item Function \verb|read| now uses {\em read patterns\/} to specify | 2498 | \item Function \verb|read| now uses \emph{read patterns} to specify |
2498 | what to read; | 2499 | what to read; |
2499 | this is incompatible with the old format options. | 2500 | this is incompatible with the old format options. |
2500 | \item Function \verb|strfind| now accepts patterns, | 2501 | \item Function \verb|strfind| now accepts patterns, |
@@ -2529,7 +2530,7 @@ The function \verb|type| now returns the string \verb|"function"| | |||
2529 | both for C and Lua functions. | 2530 | both for C and Lua functions. |
2530 | Because Lua functions and C functions are compatible, | 2531 | Because Lua functions and C functions are compatible, |
2531 | this behavior is usually more useful. | 2532 | this behavior is usually more useful. |
2532 | When needed, the second result of function {\tt type} may be used | 2533 | When needed, the second result of function \T{type} may be used |
2533 | to distinguish between Lua and C functions. | 2534 | to distinguish between Lua and C functions. |
2534 | \item | 2535 | \item |
2535 | A function definition only assigns the function value to the | 2536 | A function definition only assigns the function value to the |
@@ -2550,7 +2551,7 @@ constructor (formerly \verb|@{...}|) now are both coded like | |||
2550 | When the construction involves a function call, | 2551 | When the construction involves a function call, |
2551 | like in \verb|@func{...}|, | 2552 | like in \verb|@func{...}|, |
2552 | the new syntax does not use the \verb|@|. | 2553 | the new syntax does not use the \verb|@|. |
2553 | More important, {\em a construction function must now | 2554 | More important, \emph{a construction function must now |
2554 | explicitly return the constructed table}. | 2555 | explicitly return the constructed table}. |
2555 | \item | 2556 | \item |
2556 | The function \verb|lua_call| no longer has the parameter \verb|nparam|. | 2557 | The function \verb|lua_call| no longer has the parameter \verb|nparam|. |
@@ -2569,7 +2570,7 @@ int lua_storesubscript (void); | |||
2569 | with the parameters explicitly pushed on the stack. | 2570 | with the parameters explicitly pushed on the stack. |
2570 | \item | 2571 | \item |
2571 | The functionality of the function \verb|lua_errorfunction| has been | 2572 | The functionality of the function \verb|lua_errorfunction| has been |
2572 | replaced by the {\em fallback\/} mechanism \see{error}. | 2573 | replaced by the \emph{fallback} mechanism \see{error}. |
2573 | \item | 2574 | \item |
2574 | When calling a function from the Lua library, | 2575 | When calling a function from the Lua library, |
2575 | parameters passed through the stack | 2576 | parameters passed through the stack |