Jump to content

Array concatenation: Difference between revisions

Line 2,196:
=={{header|Perl 6}}==
{{works with|rakudo|2015-10-01}}
<lang perl6># the prefix:<|> operator (called "slip") canflattens be used to interpolate arrays into a list:Arrays
<lang perl6>
sub cat-arrays(@a, @b) {
my @array3 = |@array1, |@array2;
|@a, |@b
</lang>
}
 
my @a1 = (1,2,3);
my @a2 = (2,3,4);
cat-arrays(@a1,@a2).join(", ").say;</lang>
{{out}}
<pre>1, 2, 3, 2, 3, 4</pre>
 
=={{header|Phix}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.