chickadee » generalized-arrays » reverse-chain-interval

chain-interval intervalprocedure
reverse-chain-interval intervalprocedure

Transducers that chain the indices contained in the intervals to the transduction operation, in either forward or reverse order.

 
(import (generalized-arrays intervals)
        (transducers)
        (test))

(test "Chaining an interval to a list of symbols"
      (list 'a
            'b
            'c
            'd
            (vector 0 0)
            (vector 0 1)
            (vector 1 0)
            (vector 1 1))
      (transduce list-fold
                 (chain-interval
                   (make-default-interval (vector 2 2)))
                 (collect-list)
                 (list 'a 'b 'c 'd)))