aboutsummaryrefslogtreecommitdiff
path: root/manual/manual.of
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-10-30 11:07:01 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-10-30 11:07:01 -0300
commitd342328e5b24c9b3c6c5b33bfcf9f8534210b8e6 (patch)
tree033163b79dc14b69fc8d7160ae38cf3d9181533d /manual/manual.of
parent0149b781d438091ce086449101a916e9b4456b4e (diff)
downloadlua-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.of8
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}
2360When a Lua function is called, 2359When a Lua function is called,
2361it adjusts its list of @x{arguments} to 2360it adjusts its list of @x{arguments} to
@@ -2396,7 +2395,7 @@ g(5, r()) a=5, b=1, ... -> 2 3
2396} 2395}
2397 2396
2398The presence of a varag table in a variadic function is indicated 2397The presence of a varag table in a variadic function is indicated
2399by the @T{|name} syntax after the three dots. 2398by a name after the three dots.
2400When present, 2399When present,
2401a vararg table behaves like a read-only local variable 2400a vararg table behaves like a read-only local variable
2402with the given name that is initialized with a table. 2401with 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