Search This Blog

Monday, September 7, 2009

a dynamic java with a REPL

I found some interesting tips in a thread on Stack Overflow. It turns out that from the clojure REPL, java looks quite like a dynamic language. For example:

user> (println (apply str (interpose "\n" (map str (.getMethods (class "")))))
There are also some nice goodies in repl-utils. Try:

user> (use 'clojure.contrib.repl-utils)
user> (javadoc "")
user> (source javadoc)
user> (keys (ns-interns 'clojure.contrib.repl-utils))
user> (show String)
user> (show String 70)

No comments:

Post a Comment

Followers