Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattyw/1356557 to your computer and use it in GitHub Desktop.
Save mattyw/1356557 to your computer and use it in GitHub Desktop.
;; mattyw's solution to Reverse a Sequence
;; https://4clojure.com/problem/23
(defn reverse-func [seq]
(reduce (fn [a b] (cons b a)) '() seq))
(println (= (reverse-func [1 2 3 4 5]) [5 4 3 2 1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment