diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-10-30 11:07:01 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-10-30 11:07:01 -0300 |
| commit | d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6 (patch) | |
| tree | 033163b79dc14b69fc8d7160ae38cf3d9181533d /manual/manual.of | |
| parent | 0149b781d438091ce086449101a916e9b4456b4e (diff) | |
| download | lua-d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6.tar.gz lua-d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6.tar.bz2 lua-d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6.zip | |
Vertical bar removed from syntax of vararg table
The syntax 'function foo (a, b, ...arg)' is already used by JavaScript
for this same semantics, so it seems natural to use the same notation in
Lua.
Diffstat (limited to 'manual/manual.of')
| -rw-r--r-- | manual/manual.of | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/manual/manual.of b/manual/manual.of index ad273d62..0127df02 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -2354,8 +2354,7 @@ initialized with the argument values: | |||
| 2354 | @Produc{ | 2354 | @Produc{ |
| 2355 | @producname{parlist}@producbody{namelist @bnfopt{@bnfter{,} varargparam} @Or | 2355 | @producname{parlist}@producbody{namelist @bnfopt{@bnfter{,} varargparam} @Or |
| 2356 | varargparam} | 2356 | varargparam} |
| 2357 | @producname{varargparam}@producbody{@bnfter{...} | 2357 | @producname{varargparam}@producbody{@bnfter{...} @bnfopt{@bnfNter{Name}}} |
| 2358 | @bnfopt{@bnfter{|} @bnfNter{Name}}} | ||
| 2359 | } | 2358 | } |
| 2360 | When a Lua function is called, | 2359 | When a Lua function is called, |
| 2361 | it adjusts its list of @x{arguments} to | 2360 | it adjusts its list of @x{arguments} to |
| @@ -2396,7 +2395,7 @@ g(5, r()) a=5, b=1, ... -> 2 3 | |||
| 2396 | } | 2395 | } |
| 2397 | 2396 | ||
| 2398 | The presence of a varag table in a variadic function is indicated | 2397 | The presence of a varag table in a variadic function is indicated |
| 2399 | by the @T{|name} syntax after the three dots. | 2398 | by a name after the three dots. |
| 2400 | When present, | 2399 | When present, |
| 2401 | a vararg table behaves like a read-only local variable | 2400 | a vararg table behaves like a read-only local variable |
| 2402 | with the given name that is initialized with a table. | 2401 | with the given name that is initialized with a table. |
| @@ -9773,8 +9772,7 @@ and @bnfNter{LiteralString}, see @See{lexical}.) | |||
| 9773 | @producname{parlist}@producbody{namelist @bnfopt{@bnfter{,} varargparam} @Or | 9772 | @producname{parlist}@producbody{namelist @bnfopt{@bnfter{,} varargparam} @Or |
| 9774 | varargparam} | 9773 | varargparam} |
| 9775 | 9774 | ||
| 9776 | @producname{varargparam}@producbody{@bnfter{...} | 9775 | @producname{varargparam}@producbody{@bnfter{...} @bnfopt{@bnfNter{Name}}} |
| 9777 | @bnfopt{@bnfter{|} @bnfNter{Name}}} | ||
| 9778 | 9776 | ||
| 9779 | @producname{tableconstructor}@producbody{@bnfter{@Open} @bnfopt{fieldlist} @bnfter{@Close}} | 9777 | @producname{tableconstructor}@producbody{@bnfter{@Open} @bnfopt{fieldlist} @bnfter{@Close}} |
| 9780 | 9778 | ||
