2 (:refer-clojure :exclude (reverse))
5 (def x (list (list 1 2) (list 3 4)))
7 (defn deep-reverse [lst]
8 (cond (not (seq? lst)) lst
10 :else (cons (deep-reverse (last lst)) (deep-reverse (butlast lst)))))
12 (deftest test-simple-list
14 (deep-reverse '(1 2 3 4)) '(4 3 2 1)
15 (deep-reverse '((1 2) 3 4)) '(4 3 (2 1))
16 (deep-reverse '((1 2) (3 4))) '((4 3) (2 1))))