Anonymous user
Closures/Value capture: Difference between revisions
m
added whitespace and highlighting to the task's preamble.
(simplify description) |
m (added whitespace and highlighting to the task's preamble.) |
||
Line 2:
;Task:
Create a list of
Display the result of running any but the last function, to demonstrate that the function indeed remembers its value.
Line 13:
For each function to maintain the correct number, it has to capture the ''value'' of the variable at the time it was created, rather than just a reference to the variable, which would have a different value by the time the function was run.
<br><br>
=={{header|Ada}}==
|