How to exit the REPL
You can send the ‘end-of-file’ character. You can just press ctrl-d (*nix) or ctrl-z (Windows) to exit the REPL.
You can send the ‘end-of-file’ character. You can just press ctrl-d (*nix) or ctrl-z (Windows) to exit the REPL.
Rather late to the party, here, but you can get this from using the Leiningen plugin Ultra (which also has support for colorized stacktraces and pretty-printed test output), or by adding Whidbey to your list of Leiningen plugins instead. Sample Ultra REPL:
The REPL demo was part of “what might happen next”, i.e. after 4.0; in .NET 5.0 or something similar. This is not 4.0 functionality, and never has been.
I’ll go from high-level down to your particular problem: How Clojure (or LISPs) Generally Work REPLs, or Read-Eval-Print Loops are the core of how LISPs are designed: The reader converts a stream of characters into data structures (called Reader Forms). The evaluator takes collection of reader forms and evaluates them. The printer emits the results … Read more
You mentioned an important point which Scala lacks a bit: the documentation. The REPL is a fantastic tool, but it is not as fantastic at it can be. There are too much missing features and features which can be improved – some of them are mentioned in your post. Scaladoc is a nice tool, too, … Read more
As of node ^10, you can use the following flag when starting the repl: node –experimental-repl-await $ await myPromise()
When you quote a collection with ‘, the symbol-name will be quoted exactly as you enter it. ‘(+ x x) => (+ x x) (map namespace *1) => (nil nil nil) ‘(bingo/+ lara/y user/z) => (bingo/+ lara/y user/z) (map namespace *1) => (“bingo” “lara” “user”) When you quote a collection with the backtick, it tries … Read more
There is an alternative to reloading the class if the goal is to not have to repeat previous commands. The REPL has the command :replay which restarts the REPL environment and plays back all previous valid commands. (The invalid ones are skipped, so if it was wrong before, it won’t suddenly work.) When the REPL … Read more
If you want to clear the current namespace of all temporary variables and functions you declared you can use this one liner (or make a function of it) : (map #(ns-unmap *ns* %) (keys (ns-interns *ns*))) or (ns myutil) (defn ns-clean “Remove all internal mappings from a given name space or the current one if … Read more
You can also switch to multiline mode with Ctrl+V.