Apply a callback to an array: Difference between revisions

Content added Content deleted
No edit summary
Line 1,655: Line 1,655:


=={{header|Guish}}==
=={{header|Guish}}==
{{works with|guish|2.1.5}}
{{works with|guish|2.1.7}}
<syntaxhighlight lang="guish">
<syntaxhighlight lang="guish">
# applies add2 (adds 2) to each element
# applies add2 (adds 2) to each element
map = {
map = {
r =
r =
args = [take(1, nargs(), @*)]
args = [tail(@*)]
for x @args {
for x @args {
r = [@r, call(@1, @x)]
r = [@r, call(@1, @x)]