Programming-Idioms

Implementation
Go

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
var ab = a.concat(b);
ab = a + b
int[] a, b;
auto ab = a ~ b;
std.range;
int[] a, b;
auto ab = chain(a, b);
ab = a ++ b
ab := append(a, b...)
var ab []T
ab = append(append(ab, a...), b...)
ab = a + b
let ab = [a, b].concat();
auto ab = a;
ab.insert (ab.end (), b.begin (), b.end ());
classes
var
  a,b,ab: TList;

...
  ab := TList.Create;
  ab.Assign(a);
  ab.AddList(b);
...
$ab = array_merge($a, $b);
val ab = a ++ b
ab = a ++ b
@ab = (@a, @b)
var ab = new ArrayList<>(a);
ab.addAll(b);
(setf ab (append a b))
System.Linq
var list1 = new List<int>(){1,2,3};
var list2 = new List<int>(){4,5,6};

var list3 = list1.Concat(list2);
real, dimension(:), allocatable :: ab

ab = [a, b]
(def ab (concat a b))
var a = [1,2,3];
var b = [3,2,4];
var ab = a + b;
AB = A ++ B.
(define ab (append a b))