Apply a callback to an array: Difference between revisions

no edit summary
m (→‎{{header|R}}: Further examples)
No edit summary
Line 1,167:
<lang v>
[1 2 3 4] [dup *] map
</lang>
 
=={{header|Vorpal}}==
Given and array, A, and a function, F, mapping F over the elements of A is simple:
<lang vorpal>
A.map(F)
</lang>
If F takes 2 arguments, x and , then simply pass them to map. They will be passed to F when as it is applied to each element of A.
<lang vorpal>
A.map(F, x, y)
</lang>
 
Anonymous user