So, in Clojure you can't use Java objects with the great sequence and hashmap libs:
(def h (new java.util.HashMap))
(. h put :a 1)
(. h put :b 2)
user=> h
#=(java.util.HashMap. {:b 2, :a 1})
Hashmaps in Clojure are, like Arc's, callable:
user=> ({:a 1 :b 2} :b)
2
But not if they are Java Maps:
user=> (h :b)
java.lang.ClassCastException: java.util.HashMap (NO_SOURCE_FILE:0)
So rainbow does the right thing - let's you use Arc functions on Java objects?
By the way, Clojure's .. macro is pretty handy:
(.. System (getProperties) (get "os.name")) expands to:
(. (. System (getProperties)) (get "os.name"))
So, in Clojure you can't use Java objects with the great sequence and hashmap libs:
(def h (new java.util.HashMap))
(. h put :a 1)
(. h put :b 2)
user=> h
#=(java.util.HashMap. {:b 2, :a 1})
Hashmaps in Clojure are, like Arc's, callable:
user=> ({:a 1 :b 2} :b)
2
But not if they are Java Maps:
user=> (h :b)
java.lang.ClassCastException: java.util.HashMap (NO_SOURCE_FILE:0)
So rainbow does the right thing - let's you use Arc functions on Java objects?
By the way, Clojure's .. macro is pretty handy:
(.. System (getProperties) (get "os.name")) expands to:
(. (. System (getProperties)) (get "os.name"))