Hacker News new | past | comments | ask | show | jobs | submit login

Apologies for the days of delay - I'm on a reduced HN diet.

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"))




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: