Anonymous user
Apply a callback to an array: Difference between revisions
added Nemerle
m (→{{header|PARI/GP}}: fix version req't) |
(added Nemerle) |
||
Line 1,304:
Map(sample, NUMBER(sample), callback);
END Callback.</lang>
=={{header|Nemerle}}==
The <tt>Nemerle.Collections</tt> namespace defines the methods <tt>Iter()</tt> (if the function applied is <tt>void</tt>) and <tt>Map()</tt> (if the function applied returns a value).
<lang Nemerle>def seg = array[1, 2, 3, 5, 8, 13];
def squares = seq.Map(x => x*x);</lang>
=={{header|NewLISP}}==
|