RosettaCodeData/Task/Array-concatenation/Picat/array-concatenation.picat

13 lines
308 B
Plaintext

go =>
L1 = {1,2,3,4,5}, % define an array with {}
L2 = {6,7,8,9},
% The built-in array/list concatenation
println(L1 ++ L2),
% Using the built-in append/3 works only on lists
% so the arrays must be converted to lists.
append(L1.to_list,L2.to_list,L3),
println(L3.to_array),
nl.