Created
March 8, 2014 19:15
-
-
Save maxcountryman/9437367 to your computer and use it in GitHub Desktop.
This file contains 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
;; Greater-Than and Less-Than comparator->bool helpers | |
(defn gt? [x y] | |
(case (compare x y) | |
1 true | |
0 false | |
-1 false)) | |
(defn lt? [x y] | |
(case (compare x y) | |
1 false | |
0 false | |
-1 true)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
compare
returns positive and negative values, not necessarily just1
and-1
.