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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top