Provide a REPL that is super-friendly to beginners without bothering them with details that are hard to grasp when you are a Clojure beginner.
For instance,
def
forms return the value of the var instead of the var itselfdefn
forms return a message saying that a function has been created instead of returning the var of the function createdIf you want to try this really quickly install the Clojure CLI tools and then invoke this:
clojure -Sdeps "{:deps {viebel/klipse-repl {:mvn/version \"0.1.5\"}}}" -m klipse-repl.main
That should start a Clojure REPL that takes its input from the Rebel readline editor.
Note that I am using the clojure
command and not the clj
command
because the latter wraps the process with another readline program (rlwrap).
If you happen to like it, you will probably find it more convenient to specify an alias in your $HOME/.clojure/deps.edn
{
...
:aliases {:rebel {:extra-deps {viebel/klipse-repl {:mvn/version "0.1.5"}}
:main-opts ["-m" "klipse-repl.main"]}}
}
And then run with a simpler:
$ clojure -A:klipse-repl
Still, I am using the clojure
command and not the clj
command
because the latter wraps the process with another readline program (rlwrap).
The features of this section can be disabled by the --no-easy-defs
flag.
def
forms return the value of the var instead of the var itselfdefn
forms return a message saying that a function has been created instead of returning the var of the function createdIn order to enable the features listed in this section, you need to pass the --cool-forms flag
.
add dependencies in your global or local deps.edn
and call (refresh-classpath)
add one or more dependencies on the fly - following deps.edn
format:
user=> (add-deps '{tupelo {:mvn/version "0.9.103"}})
Display classpath as a collection with (classpath)
You can launch the REPL as a socket REPL server and connect with it remotely
$ clojure -A:klipse-repl --port 9876
launching socket repl on port 9876
Welcome to Klipse REPL (Read-Eval-Print Loop)
Clojure 1.9.0
user=> (def a 1)
And then from another terminal, you connect with nc
or telnet
:
$ nc localhost 9876
Welcome to Klipse REPL (Read-Eval-Print Loop)
Clojure 1.9.0
user=> a
1
Be aware that the state of the REPL is shared between the host and all its remote connections.
All of the great features of Bruce Hauman's rebel-readline are available in this REPL for the simple reason that this REPL is built on top of rebel-readline.
This REPL runs on top of the awesome rebel-readline by Bruce Hauman.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close