Nested function: Difference between revisions
Mark as draft, move reference link to top
(Lua) |
Thundergnat (talk | contribs) (Mark as draft, move reference link to top) |
||
Line 1:
{{draft task}}
In many languages, functions can be nested, so there are outer functions and inner functions. The inner function can then access the variables of the outer function. In most languages, the inner function can also modify variables from the outer function.
The following examples for <tt>MakeList</tt> or <tt>makeList</tt> generate the following text:
Line 55 ⟶ 61:
print(makeList(". "))
</lang>
▲* [https://en.wikipedia.org/wiki/Nested_function Wikipedia] article on nested functions
|