Created
July 5, 2012 17:06
-
-
Save ngn999/3054916 to your computer and use it in GitHub Desktop.
max
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
(defn max2 [ & coll ] | |
(if (empty? coll) | |
nil | |
((fn iter [s m] | |
(if (empty? s) | |
m | |
(if (>= (first s) m) | |
(iter (rest s) (first s)) | |
(iter (rest s) m)))) | |
(rest coll) (first coll)) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment