Apply a callback to an array: Difference between revisions

Content added Content deleted
(PascalABC.NET)
 
Line 2,565: Line 2,565:
=={{header|Pascal}}==
=={{header|Pascal}}==
See [[Apply_a_callback_to_an_array#Delphi | Delphi]]
See [[Apply_a_callback_to_an_array#Delphi | Delphi]]

=={{header|PascalABC.NET}}==
<syntaxhighlight lang="pascal">
begin
var a := Arr(1..10);
a := a.Select(x -> x * x).ToArray;
a.ForEach(x -> Print(x));
end.
</syntaxhighlight>
{{out}}
<pre>
1 4 9 16 25 36 49 64 81 100
</pre>



=={{header|Perl}}==
=={{header|Perl}}==