Apply a callback to an array: Difference between revisions
→{{header|langur}}
m (→{{header|Wren}}: Changed to Wren S/H) |
Langurmonkey (talk | contribs) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 440:
2.23606798
</pre>
=={{header|Binary Lambda Calculus}}==
In the lambda calculus, we can map over a list as in https://github.com/tromp/AIT/blob/master/lists/map.lam, which gives the following BLC program to negate every bit of input:
<pre>010001101000000101100000000001011000000101111111010110010111111101111110111010</pre>
=={{header|BQN}}==
<syntaxhighlight lang="bqn">Square ← ט
array ← 2‿3‿5‿7‿11‿13
Square¨ array</syntaxhighlight>
The use of the ¨ modifier is the general approach, but actually not necessary with arithmetic functions.
{{out}}
<pre>⟨ 4 9 25 49 121 169 ⟩</pre>
=={{header|Bracmat}}==
Line 1,113 ⟶ 1,127:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import system'routines;
Line 1,120 ⟶ 1,134:
public program()
{
new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.forEach
}</syntaxhighlight>
Line 1,952 ⟶ 1,966:
=={{header|langur}}==
<syntaxhighlight lang="langur">writeln map
{{out}}
|