Forked from anonymous/mattyw-4clojure-solution23.clj
Created
November 10, 2011 23:04
-
-
Save mattyw/1356557 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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