Clojure in Org Mode
You can run a Clojure REPL inside of Org Mode with Cider. You will need to add this code block to your
(require 'ob-clojure) (setq org-babel-clojure-backend 'cider) (require 'cider)
Now when you are in a
.org file, you can create a block with arbitrary clojure code. You can run
M-x cider-jack-in or
C-c C-c inside the code block and choose
cider-jack-in to create a cider repl. It will compile and run your clojure code.
(defn duplicate-entries [s] (apply concat (map (fn [e] [e e]) s))) (duplicate-entries [1 2 3])
|(1 1 2 2 3 3)|
You can even run code from earlier blocks inside new blocks.
(duplicate-entries [  [1 2 3]])