Skip to content

Instantly share code, notes, and snippets.

@ponkore
Created March 16, 2012 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ponkore/2047816 to your computer and use it in GitHub Desktop.
Save ponkore/2047816 to your computer and use it in GitHub Desktop.
reverse sample implementation (for study)
;;; reverse (not elegant)
(defn reverse-sample [coll]
(if (empty? coll) ()
(reduce #(cons %2 (if (seq? %1) %1 (list %1))) (seq coll))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment