chickadee » generalized-arrays » array-append

array-append axis arr brrprocedure

Appends the array brr to the array arr along the provided axis. An error is signaled if the arrays have different ranks, if the provided axis is less than zero or greater than the rank of the arrays, or if the axes outside of axis are not equal.

(import generalized-arrays

(define a
  (make-array vector-storage-class #(2 2) 0))

(define b
  (make-array vector-storage-class #(2 2) 1))

(define c
  (array-append 0 a b))

(test-assert "Appending arrays a and b produces 4x2 array"
  (array=? c
           (make-array-from-storage vector-storage-class
                                    #(4 2)
                                    (vector 0 0
                                            0 0
                                            1 1
                                            1 1))))