Apply a callback to an array: Difference between revisions
no edit summary
No edit summary |
|||
Line 2,241:
3 squared = 9
4 squared = 16
=={{header|Nutt}}==
<syntaxhighlight lang="Nutt">
module main
imports native.io.output.say
operator |> (arr:Array,f:Procedure):Array==>{f(x) of x |-> arr}
say({0,1,2,3,4,5}|>a==>a+2)//|{2,3,4,5,6,7}
end
</syntaxhighlight>
=={{header|Oberon-2}}==
|