aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manual/manual.of31
1 files changed, 17 insertions, 14 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 935990d0..f92be508 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -1,4 +1,4 @@
1@Ci{$Id: manual.of,v 1.175 2018/06/18 19:17:35 roberto Exp $} 1@Ci{$Id: manual.of,v 1.175 2018/06/18 19:17:35 roberto Exp roberto $}
2@C{[(-------------------------------------------------------------------------} 2@C{[(-------------------------------------------------------------------------}
3@manual{ 3@manual{
4 4
@@ -925,14 +925,17 @@ at the end of this manual.
925@sect2{lexical| @title{Lexical Conventions} 925@sect2{lexical| @title{Lexical Conventions}
926 926
927Lua is a @x{free-form} language. 927Lua is a @x{free-form} language.
928It ignores spaces (including new lines) and comments 928It ignores spaces and comments between lexical elements (@x{tokens}),
929between lexical elements (@x{tokens}),
930except as delimiters between @x{names} and @x{keywords}. 929except as delimiters between @x{names} and @x{keywords}.
930In source code,
931Lua recognizes as spaces the standard ASCII white-space
932characters space, form feed, newline,
933carriage return, horizontal tab, and vertical tab.
931 934
932@def{Names} 935@def{Names}
933(also called @def{identifiers}) 936(also called @def{identifiers})
934in Lua can be any string of letters, 937in Lua can be any string of Latin letters,
935digits, and underscores, 938Arabic-Indic digits, and underscores,
936not beginning with a digit and 939not beginning with a digit and
937not being a reserved word. 940not being a reserved word.
938Identifiers are used to name variables, table fields, and labels. 941Identifiers are used to name variables, table fields, and labels.
@@ -2436,7 +2439,7 @@ it can do whatever it wants on that Lua state,
2436as it should be already protected. 2439as it should be already protected.
2437However, 2440However,
2438when C code operates on other Lua states 2441when C code operates on other Lua states
2439(e.g., a Lua parameter to the function, 2442(e.g., a Lua-state argument to the function,
2440a Lua state stored in the registry, or 2443a Lua state stored in the registry, or
2441the result of @Lid{lua_newthread}), 2444the result of @Lid{lua_newthread}),
2442it should use them only in API calls that cannot raise errors. 2445it should use them only in API calls that cannot raise errors.
@@ -5376,7 +5379,7 @@ In words, if the argument @id{arg} is nil or absent,
5376the macro results in the default @id{dflt}. 5379the macro results in the default @id{dflt}.
5377Otherwise, it results in the result of calling @id{func} 5380Otherwise, it results in the result of calling @id{func}
5378with the state @id{L} and the argument index @id{arg} as 5381with the state @id{L} and the argument index @id{arg} as
5379parameters. 5382arguments.
5380Note that it evaluates the expression @id{dflt} only if needed. 5383Note that it evaluates the expression @id{dflt} only if needed.
5381 5384
5382} 5385}
@@ -6408,7 +6411,7 @@ Each entry in this table is a @def{searcher function}.
6408When looking for a module, 6411When looking for a module,
6409@Lid{require} calls each of these searchers in ascending order, 6412@Lid{require} calls each of these searchers in ascending order,
6410with the module name (the argument given to @Lid{require}) as its 6413with the module name (the argument given to @Lid{require}) as its
6411sole parameter. 6414sole argument.
6412The function can return another function (the module @def{loader}) 6415The function can return another function (the module @def{loader})
6413plus an extra value that will be passed to that loader, 6416plus an extra value that will be passed to that loader,
6414or a string explaining why it did not find that module 6417or a string explaining why it did not find that module
@@ -7355,7 +7358,7 @@ Returns the arc sine of @id{x} (in radians).
7355 7358
7356@index{atan2} 7359@index{atan2}
7357Returns the arc tangent of @T{y/x} (in radians), 7360Returns the arc tangent of @T{y/x} (in radians),
7358but uses the signs of both parameters to find the 7361but uses the signs of both arguments to find the
7359quadrant of the result. 7362quadrant of the result.
7360(It also handles correctly the case of @id{x} being zero.) 7363(It also handles correctly the case of @id{x} being zero.)
7361 7364
@@ -7596,7 +7599,7 @@ When called with a file name, it opens the named file (in text mode),
7596and sets its handle as the default input file. 7599and sets its handle as the default input file.
7597When called with a file handle, 7600When called with a file handle,
7598it simply sets this file handle as the default input file. 7601it simply sets this file handle as the default input file.
7599When called without parameters, 7602When called without arguments,
7600it returns the current default input file. 7603it returns the current default input file.
7601 7604
7602In case of errors this function raises the error, 7605In case of errors this function raises the error,
@@ -7743,7 +7746,7 @@ the function returns a string or a number with the characters read,
7743or @nil if it cannot read data with the specified format. 7746or @nil if it cannot read data with the specified format.
7744(In this latter case, 7747(In this latter case,
7745the function does not read subsequent formats.) 7748the function does not read subsequent formats.)
7746When called without parameters, 7749When called without arguments,
7747it uses a default format that reads the next line 7750it uses a default format that reads the next line
7748(see below). 7751(see below).
7749 7752
@@ -8166,8 +8169,8 @@ The first parameter or local variable has @N{index 1}, and so on,
8166following the order that they are declared in the code, 8169following the order that they are declared in the code,
8167counting only the variables that are active 8170counting only the variables that are active
8168in the current scope of the function. 8171in the current scope of the function.
8169Negative indices refer to vararg parameters; 8172Negative indices refer to vararg arguments;
8170@num{-1} is the first vararg parameter. 8173@num{-1} is the first vararg argument.
8171The function returns @nil if there is no variable with the given index, 8174The function returns @nil if there is no variable with the given index,
8172and raises an error when called with a level out of range. 8175and raises an error when called with a level out of range.
8173(You can call @Lid{debug.getinfo} to check whether the level is valid.) 8176(You can call @Lid{debug.getinfo} to check whether the level is valid.)
@@ -8418,7 +8421,7 @@ $ lua -e "print(arg[1])"
8418} 8421}
8419will print @St{-e}. 8422will print @St{-e}.
8420If there is a script, 8423If there is a script,
8421the script is called with parameters 8424the script is called with arguments
8422@T{arg[1]}, @Cdots, @T{arg[#arg]}. 8425@T{arg[1]}, @Cdots, @T{arg[#arg]}.
8423(Like all chunks in Lua, 8426(Like all chunks in Lua,
8424the script is compiled as a vararg function.) 8427the script is compiled as a vararg function.)