Clojure

Leiningen

Download ~/bin/lein.bat and run to setup. lein.bat has a variable to indicate the version being used. This can be changed to up/downgrade. Keep old versions of clojure should an upgrade break things.

~/.m2 contains the repository.

cd into the project directory and $lein deps to install/upgrade dependencies.

run lein clean occasionally
lein clean - delete build artifacts
lein deps - download dependencies, including clojure
lein javac - compile java code in project

Clojure

Clojure-mode

Cider

Open core.clj
C-c M-j to cider-jack-in; repl prompt is XXX.core>

C-c C-e to evaluate an expression.

M-x occur ‘defn’ will open a new buffer with all method definitions listed. Click on one to go to it.

M-x imenu enter a regex to search method names with, code completion available.

Init.el

(require ‘cider)

;;from: http://blog.jenkster.com/2013/12/a-cider-excursion.html

(defun cider-namespace-refresh ()
(interactive)
(cider-interactive-eval
“(require ‘clojure.tools.namespace.repl)
(clojure.tools.namespace.repl/refresh)”))

;;also see http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded

(define-key clojure-mode-map (kbd “M-r”) ‘cider-namespace-refresh)

Miscellaneous

Clojure integration with R

Share