Skip to content

Instantly share code, notes, and snippets.

@maxp
Created October 20, 2012 02:51
Show Gist options
  • Select an option

  • Save maxp/3921809 to your computer and use it in GitHub Desktop.

Select an option

Save maxp/3921809 to your computer and use it in GitHub Desktop.
(defn
^{:doc "mymax [xs+] gets the maximum value in xs using > "
:test (fn []
(assert (= 42 (mymax 2 42 5 4))))
:user/comment "this is the best fn ever!"}
mymax
([x] x)
([x y] (if (> x y) x y))
([x y & more]
(reduce mymax (mymax x y) more)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment