chickadee » generalized-arrays » reverse-chain-array

chain-array arrayprocedure
reverse-chain-array arrayprocedure

Transducer that chains the contents of the provided array onto the end of the transduction. reverse-chain-array works similar to chain-array, but chains the array onto the transduction in reverse-lexicographic ordering.

 
(import generalized-arrays
        transducers
        test)

(define a
  (make-array-from-storage vector-storage-class
                           (vector 3 3)
                           (vector 'a 'b 'c
                                   'd 'e 'f
                                   'g 'h 'i)))

(test "Chaining array to end of list-transduction"
      (list 1 2 3 'a 'b 'c 'd 'e 'f 'g 'h 'i)
      (transduce list-fold
                 (chain-array a)
                 (collect-list)
                 (list 1 2 3)))