diff options
-rw-r--r-- | manual/manual.of | 31 |
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 | ||
927 | Lua is a @x{free-form} language. | 927 | Lua is a @x{free-form} language. |
928 | It ignores spaces (including new lines) and comments | 928 | It ignores spaces and comments between lexical elements (@x{tokens}), |
929 | between lexical elements (@x{tokens}), | ||
930 | except as delimiters between @x{names} and @x{keywords}. | 929 | except as delimiters between @x{names} and @x{keywords}. |
930 | In source code, | ||
931 | Lua recognizes as spaces the standard ASCII white-space | ||
932 | characters space, form feed, newline, | ||
933 | carriage return, horizontal tab, and vertical tab. | ||
931 | 934 | ||
932 | @def{Names} | 935 | @def{Names} |
933 | (also called @def{identifiers}) | 936 | (also called @def{identifiers}) |
934 | in Lua can be any string of letters, | 937 | in Lua can be any string of Latin letters, |
935 | digits, and underscores, | 938 | Arabic-Indic digits, and underscores, |
936 | not beginning with a digit and | 939 | not beginning with a digit and |
937 | not being a reserved word. | 940 | not being a reserved word. |
938 | Identifiers are used to name variables, table fields, and labels. | 941 | Identifiers are used to name variables, table fields, and labels. |
@@ -2436,7 +2439,7 @@ it can do whatever it wants on that Lua state, | |||
2436 | as it should be already protected. | 2439 | as it should be already protected. |
2437 | However, | 2440 | However, |
2438 | when C code operates on other Lua states | 2441 | when 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, |
2440 | a Lua state stored in the registry, or | 2443 | a Lua state stored in the registry, or |
2441 | the result of @Lid{lua_newthread}), | 2444 | the result of @Lid{lua_newthread}), |
2442 | it should use them only in API calls that cannot raise errors. | 2445 | it 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, | |||
5376 | the macro results in the default @id{dflt}. | 5379 | the macro results in the default @id{dflt}. |
5377 | Otherwise, it results in the result of calling @id{func} | 5380 | Otherwise, it results in the result of calling @id{func} |
5378 | with the state @id{L} and the argument index @id{arg} as | 5381 | with the state @id{L} and the argument index @id{arg} as |
5379 | parameters. | 5382 | arguments. |
5380 | Note that it evaluates the expression @id{dflt} only if needed. | 5383 | Note 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}. | |||
6408 | When looking for a module, | 6411 | When 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, |
6410 | with the module name (the argument given to @Lid{require}) as its | 6413 | with the module name (the argument given to @Lid{require}) as its |
6411 | sole parameter. | 6414 | sole argument. |
6412 | The function can return another function (the module @def{loader}) | 6415 | The function can return another function (the module @def{loader}) |
6413 | plus an extra value that will be passed to that loader, | 6416 | plus an extra value that will be passed to that loader, |
6414 | or a string explaining why it did not find that module | 6417 | or 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} |
7357 | Returns the arc tangent of @T{y/x} (in radians), | 7360 | Returns the arc tangent of @T{y/x} (in radians), |
7358 | but uses the signs of both parameters to find the | 7361 | but uses the signs of both arguments to find the |
7359 | quadrant of the result. | 7362 | quadrant 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), | |||
7596 | and sets its handle as the default input file. | 7599 | and sets its handle as the default input file. |
7597 | When called with a file handle, | 7600 | When called with a file handle, |
7598 | it simply sets this file handle as the default input file. | 7601 | it simply sets this file handle as the default input file. |
7599 | When called without parameters, | 7602 | When called without arguments, |
7600 | it returns the current default input file. | 7603 | it returns the current default input file. |
7601 | 7604 | ||
7602 | In case of errors this function raises the error, | 7605 | In case of errors this function raises the error, |
@@ -7743,7 +7746,7 @@ the function returns a string or a number with the characters read, | |||
7743 | or @nil if it cannot read data with the specified format. | 7746 | or @nil if it cannot read data with the specified format. |
7744 | (In this latter case, | 7747 | (In this latter case, |
7745 | the function does not read subsequent formats.) | 7748 | the function does not read subsequent formats.) |
7746 | When called without parameters, | 7749 | When called without arguments, |
7747 | it uses a default format that reads the next line | 7750 | it 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, | |||
8166 | following the order that they are declared in the code, | 8169 | following the order that they are declared in the code, |
8167 | counting only the variables that are active | 8170 | counting only the variables that are active |
8168 | in the current scope of the function. | 8171 | in the current scope of the function. |
8169 | Negative indices refer to vararg parameters; | 8172 | Negative indices refer to vararg arguments; |
8170 | @num{-1} is the first vararg parameter. | 8173 | @num{-1} is the first vararg argument. |
8171 | The function returns @nil if there is no variable with the given index, | 8174 | The function returns @nil if there is no variable with the given index, |
8172 | and raises an error when called with a level out of range. | 8175 | and 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 | } |
8419 | will print @St{-e}. | 8422 | will print @St{-e}. |
8420 | If there is a script, | 8423 | If there is a script, |
8421 | the script is called with parameters | 8424 | the 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, |
8424 | the script is compiled as a vararg function.) | 8427 | the script is compiled as a vararg function.) |