When you start up a CLJS REPL based on cljs.repl
, things are much improved compared to their state prior to the beginning of 2015. But, there are a few gaps relative to the experience you get when you start up lein repl
(and are dropped into REPLy).
Some of these things may or may not be appropriate for consideration in the base cljs.repl
, but I'd like to at least enumerate the differences. If you know of one, feel free to comment and I can add to the list here:
- Auto-completion (Type
(ma
and then hit tab to see list, type(mapc
and hit tab and it will complete to(mapcat
.) - Interruptible eval (Ctrl-C a long-running eval)
- Break out of multi-line edit (e.g., type
(map
, hit return and then ctrl-c to get back to prompt) - Paste really long lines (longer than tty buffer size)
- Line editing and history (
rlwrap
) - Evaluating
ns
form doesn't result in the availability of symbols already established in the JavaScript environment. (Compare: If youlein repl :connect host:port
to an nREPL server that has already loaded a namespace, thenns
will reflect this.)
Note: It is more appropriate to compare basic ClojureScript REPLs to what you get if you download Clojure and then do java -jar clojure-1.6.0.jar
, and in that case ClojureScript is pretty much at parity with Clojure.
When I go into a namespace, I can't refer to vars that have been aliased by the namespace declaration.
Example:
https://github.com/borkdude/lein2boot
Start the server:
lein repl
+(start-server)
Start figwheel:
lein figwheel
and wait untilmain.js
is compiledOpen browser, REPL appears in figwheel