diff options
Diffstat (limited to 'manual/manual.of')
-rw-r--r-- | manual/manual.of | 15 |
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 | } |
2234 | The statement | 2235 | The statement |
@@ -2247,6 +2248,7 @@ translates to | |||
2247 | @verbatim{ | 2248 | @verbatim{ |
2248 | t.a.b.c.f = function () @rep{body} end | 2249 | t.a.b.c.f = function () @rep{body} end |
2249 | } | 2250 | } |
2251 | |||
2250 | The statement | 2252 | The statement |
2251 | @verbatim{ | 2253 | @verbatim{ |
2252 | local function f () @rep{body} end | 2254 | local function f () @rep{body} end |
@@ -2260,7 +2262,15 @@ not to | |||
2260 | local f = function () @rep{body} end | 2262 | local 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 |
2263 | contains references to @id{f}.) | 2265 | contains recursive references to @id{f}.) |
2266 | Similarly, the statement | ||
2267 | @verbatim{ | ||
2268 | global function f () @rep{body} end | ||
2269 | } | ||
2270 | translates to | ||
2271 | @verbatim{ | ||
2272 | global f; f = function () @rep{body} end | ||
2273 | } | ||
2264 | 2274 | ||
2265 | A function definition is an executable expression, | 2275 | A function definition is an executable expression, |
2266 | whose value has type @emph{function}. | 2276 | whose value has type @emph{function}. |
@@ -2323,7 +2333,7 @@ then the function returns with no results. | |||
2323 | @index{multiple return} | 2333 | @index{multiple return} |
2324 | There is a system-dependent limit on the number of values | 2334 | There is a system-dependent limit on the number of values |
2325 | that a function may return. | 2335 | that a function may return. |
2326 | This limit is guaranteed to be greater than 1000. | 2336 | This limit is guaranteed to be at least 1000. |
2327 | 2337 | ||
2328 | The @emphx{colon} syntax | 2338 | The @emphx{colon} syntax |
2329 | is used to emulate @def{methods}, | 2339 | is 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 | } |