1

Problem Description

I would like to call ClojureScript functions (that I've already written in CLJS, compiled and loaded into the browser) at the REPL and have them execute in the context of my browser window.

Setup

M-x set-variable <ret> inferior-lisp-program <ret> "lein trampoline cljsbuild repl-listen"

(ns ...
  (:require ...
...
     [clojure.browser.repl :as repl]
...)
(repl/connect "http://localhost:9000/repl")

Attempted Approaches

in-ns doesn't work in ClojureScript, so the approach that I've settled on for now is to simply kill/yank the relevant CS functions into my REPL. This is neither a terrific nor sustainable approach, though, so I seek advice and input and Emacs mentorship.

Ideal Solution

I really want all of the nrepl.el functionality I've come to love in Clojure development in my ClojureScript workflow as well. This would entail loading files, evaluating S-expressions (and seeing return values in the minibuffer), the whole nine yards. I understand if the toolchain hasn't hit that level of maturity yet, and look forward to suggestions on building a robust Emacs/CLJS setup.

benkay
  • 589
  • 5
  • 14
  • @Jared314 is spot on, I'm using Austin currently and you do get things like return values in the minibuffer; loading files is certainly doable though you may have to choose your workflow with respect to things like lein-cljsbuild auto. There are older tools than Austin by which you could achieve the same effects I believe but Austin seems like the best in class at the moment. – georgek Oct 13 '13 at 18:05

1 Answers1

3

Take a look at the Austin project for a ClojureScript repl with nrepl support.

Jared314
  • 5,181
  • 24
  • 30