Task

Show how to concatenate two arrays in your language.



If this is as simple as array1 + array2, so be it.




 
> A := Array( [ 1, 2, 3 ] );
                             A := [1, 2, 3]
 
> B := Vector['row']( [ sin( x ), cos( x ), tan( x ) ] );
                     B := [sin(x), cos(x), tan(x)]
 
> ArrayTools:-Concatenate( 1, A, B ); # stack vertically
                      [  1         2         3   ]
                      [                          ]
                      [sin(x)    cos(x)    tan(x)]
 
> ArrayTools:-Concatenate( 2, A, B ); # stack horizontally
                   [1, 2, 3, sin(x), cos(x), tan(x)]
 
> M := << a, b, c ; d, e, f >>; # a matrix
                                [a    b    c]
                           M := [           ]
                                [d    e    f]
 
> ArrayTools:-Concatenate( 1, M, A );
                             [a    b    c]
                             [           ]
                             [d    e    f]
                             [           ]
                             [1    2    3]
 