Closures/Value capture: Difference between revisions
Content added Content deleted
(Add Axiom task) |
|||
Line 12: | Line 12: | ||
test() == [(() +-> i^2) for i in 1..10]</lang> |
test() == [(() +-> i^2) for i in 1..10]</lang> |
||
This can called from the interpreter using: |
This can be called from the interpreter using: |
||
<lang Axiom>[x() for x in test()]</lang> |
<lang Axiom>[x() for x in test()]</lang> |
||
Line 18: | Line 18: | ||
<lang Axiom>[1,4,9,16,25,36,49,64,81,100] |
<lang Axiom>[1,4,9,16,25,36,49,64,81,100] |
||
Type: List(Integer)</lang> |
Type: List(Integer)</lang> |
||
=={{header|C}}== |
=={{header|C}}== |