chickadee » data-structures » join

join LISTOFLISTS #!optional LISTprocedure

Concatenates the lists in LISTOFLISTS with LIST placed between each sublist. LIST defaults to the empty list.

(join '((a b) (c d) (e)) '(x y)) ==> (a b x y c d x y e)
(join '((p q) () (r (s) t)) '(-))  ==> (p q - - r (s) t)

join could be implemented as follows:

(define (join lstoflsts #!optional (lst '()))
  (apply append (intersperse lstoflists lst)) )