Skip to content

Instantly share code, notes, and snippets.

@ngn999
Created July 5, 2012 17:06
Show Gist options
  • Save ngn999/3054916 to your computer and use it in GitHub Desktop.
Save ngn999/3054916 to your computer and use it in GitHub Desktop.
max
(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