4 ;; take a list of nested lists and return a flat list with elements
5 ;; in the same left-to-right order
7 (cond (not (seq? lst)) (list lst)
9 :else (concat (fringe (first lst))
10 (fringe (rest lst)))))
12 (deftest test-fringe-with-simple-list
13 (is (= (fringe '(1 2 3 4)) '(1 2 3 4))))
15 (deftest test-fringe-with-nested-list
17 (fringe '((1 2) 3 4)) '(1 2 3 4)
18 (fringe '(1 2 (3 4))) '(1 2 3 4)
19 (fringe '((1 2) (3 4))) '(1 2 3 4)))