A Clojure version of my Yahoo Finance Ruby gem seemed like an interesting challenge and a good way to learn Clojure better. This version uses Apache HttpClient, which is significantly slower than libcurl. A libcurl version is on the way. Continue Reading »

Popularity: 45% [?]

Debuggers like JSwat and Eclipse can be remotely attached to live Clojure processes via TCP, but you have to tell the JVM to enable remote debugging when you start it. Leiningen does not presently have an (obvious) way to set java command line flags in project.clj, but it does pass the JAVA_OPTS environment variable to the JVM, so you can do:

JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n" lein swank
# or "lein repl", etc.

to enable remote debugging. Watch the output for the port it allocates, and put that into JSwat/Eclipse/etc. Continue Reading »

Popularity: 12% [?]

Rincanter allows one to access the R statistical programming language from Clojure. Rincanter also integrates R with Incanter for charting and more stats. Rincanter is based on rJava‘s JRI R-from-Java bridge. Getting this working required making a JNI library available to Clojure via an as-yet-undocumented Leiningen setting, :native-path. Continue Reading »

Popularity: 17% [?]

Memoize in Clojure is cool. Memoize is even built in to the core Clojure API. Resetting the built-in version is impossible since the atom used as a cache is hidden in a closure, but it’s easy to write a custom resettable version. Here are two versions that we came up with on IRC today. Continue Reading »

Popularity: 40% [?]

Clojure-mode for Emacs will clobber any line-final commas, even if they’re embedded in a string literal. O_o Continue Reading »

Popularity: 3% [?]