aboutsummaryrefslogtreecommitdiff
path: root/manual/manual.of
diff options
context:
space:
mode:
Diffstat (limited to 'manual/manual.of')
-rw-r--r--manual/manual.of15
1 files changed, 13 insertions, 2 deletions
diff --git a/manual/manual.of b/manual/manual.of
index ace5d375..cc71aaad 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -2229,6 +2229,7 @@ The following syntactic sugar simplifies function definitions:
2229@Produc{ 2229@Produc{
2230@producname{stat}@producbody{@Rw{function} funcname funcbody} 2230@producname{stat}@producbody{@Rw{function} funcname funcbody}
2231@producname{stat}@producbody{@Rw{local} @Rw{function} @bnfNter{Name} funcbody} 2231@producname{stat}@producbody{@Rw{local} @Rw{function} @bnfNter{Name} funcbody}
2232@producname{stat}@producbody{@Rw{global} @Rw{function} @bnfNter{Name} funcbody}
2232@producname{funcname}@producbody{@bnfNter{Name} @bnfrep{@bnfter{.} @bnfNter{Name}} @bnfopt{@bnfter{:} @bnfNter{Name}}} 2233@producname{funcname}@producbody{@bnfNter{Name} @bnfrep{@bnfter{.} @bnfNter{Name}} @bnfopt{@bnfter{:} @bnfNter{Name}}}
2233} 2234}
2234The statement 2235The statement
@@ -2247,6 +2248,7 @@ translates to
2247@verbatim{ 2248@verbatim{
2248t.a.b.c.f = function () @rep{body} end 2249t.a.b.c.f = function () @rep{body} end
2249} 2250}
2251
2250The statement 2252The statement
2251@verbatim{ 2253@verbatim{
2252local function f () @rep{body} end 2254local function f () @rep{body} end
@@ -2260,7 +2262,15 @@ not to
2260local f = function () @rep{body} end 2262local f = function () @rep{body} end
2261} 2263}
2262(This only makes a difference when the body of the function 2264(This only makes a difference when the body of the function
2263contains references to @id{f}.) 2265contains recursive references to @id{f}.)
2266Similarly, the statement
2267@verbatim{
2268global function f () @rep{body} end
2269}
2270translates to
2271@verbatim{
2272global f; f = function () @rep{body} end
2273}
2264 2274
2265A function definition is an executable expression, 2275A function definition is an executable expression,
2266whose value has type @emph{function}. 2276whose value has type @emph{function}.
@@ -2323,7 +2333,7 @@ then the function returns with no results.
2323@index{multiple return} 2333@index{multiple return}
2324There is a system-dependent limit on the number of values 2334There is a system-dependent limit on the number of values
2325that a function may return. 2335that a function may return.
2326This limit is guaranteed to be greater than 1000. 2336This limit is guaranteed to be at least 1000.
2327 2337
2328The @emphx{colon} syntax 2338The @emphx{colon} syntax
2329is used to emulate @def{methods}, 2339is used to emulate @def{methods},
@@ -9569,6 +9579,7 @@ and @bnfNter{LiteralString}, see @See{lexical}.)
9569@OrNL @Rw{for} namelist @Rw{in} explist @Rw{do} block @Rw{end} 9579@OrNL @Rw{for} namelist @Rw{in} explist @Rw{do} block @Rw{end}
9570@OrNL @Rw{function} funcname funcbody 9580@OrNL @Rw{function} funcname funcbody
9571@OrNL @Rw{local} @Rw{function} @bnfNter{Name} funcbody 9581@OrNL @Rw{local} @Rw{function} @bnfNter{Name} funcbody
9582@OrNL @Rw{global} @Rw{function} @bnfNter{Name} funcbody
9572@OrNL @Rw{local} attnamelist @bnfopt{@bnfter{=} explist} 9583@OrNL @Rw{local} attnamelist @bnfopt{@bnfter{=} explist}
9573@OrNL @Rw{global} attnamelist 9584@OrNL @Rw{global} attnamelist
9574} 9585}