Hi!

Am 27.02.2009 um 18:03 schrieb Phil Hagelberg:

> Agreed. Am curious as to what the idiomatic way to check to see if one
> string is alphabetically greater than another is though.

"compare" seems to do the right thing in most cases. You could define  
shorthands if that's too much typing:

user=> (defn << [a b] (neg? (compare a b)))
#'user/<<
user=> (defn >> [a b] (pos? (compare a b)))
#'user/>>
user=> (>> "d" "abc")
true
user=> (<< "d" "abc")
false
user=> (<< (Integer. "3") (Long. "4"))
true
user=> (>> (Integer. "3") (Long. "4"))
false

Kind regards,
achim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to