(-main & args)(break)(contextual-eval ctx expr)A drop in replacement for clojure.main/repl-read, since a readline can return multiple Clojure forms this function is stateful and buffers the forms and returns the next form on subsequent reads.
This function is a constructor that takes a line-reader and returns
a function that can replace clojure.main/repl-read.
Example Usage:
(clojure.main/repl :prompt (fn []) ;; prompt is handled by line-reader :read (clj-repl-read (line-reader (rebel-readline.clojure.service.local/create))))
Or catch a bad terminal error and fall back to clojure.main/repl-read:
(clojure.main/repl :prompt (fn []) :read (try (clj-repl-read (line-reader (rebel-readline.clojure.service.local/create))) (catch clojure.lang.ExceptionInfo e (if (-> e ex-data :type (= :rebel-readline.jline-api/bad-terminal)) (do (println (.getMessage e)) clojure.main/repl-read) (throw e)))))
A drop in replacement for clojure.main/repl-read, since a readline
can return multiple Clojure forms this function is stateful and
buffers the forms and returns the next form on subsequent reads.
This function is a constructor that takes a line-reader and returns
a function that can replace `clojure.main/repl-read`.
Example Usage:
(clojure.main/repl
:prompt (fn []) ;; prompt is handled by line-reader
:read (clj-repl-read
(line-reader
(rebel-readline.clojure.service.local/create))))
Or catch a bad terminal error and fall back to clojure.main/repl-read:
(clojure.main/repl
:prompt (fn [])
:read (try
(clj-repl-read
(line-reader
(rebel-readline.clojure.service.local/create)))
(catch clojure.lang.ExceptionInfo e
(if (-> e ex-data :type (= :rebel-readline.jline-api/bad-terminal))
(do (println (.getMessage e))
clojure.main/repl-read)
(throw e)))))(local-context)(main options)(repl & opts)(repl* {:keys [:rebel-readline/config] :as opts})(syntax-highlight-prn x)Print a syntax highlighted clojure value.
This printer respects the current color settings set in the service.
The rebel-readline.jline-api/*line-reader* and
rebel-readline.jline-api/*service* dynamic vars have to be set for
this to work.
See rebel-readline.main for an example of how this function is normally used
Print a syntax highlighted clojure value. This printer respects the current color settings set in the service. The `rebel-readline.jline-api/*line-reader*` and `rebel-readline.jline-api/*service*` dynamic vars have to be set for this to work. See `rebel-readline.main` for an example of how this function is normally used
(syntax-highlight-prn* x)Print a syntax highlighted clojure string.
This printer respects the current color settings set in the service.
The rebel-readline.jline-api/*line-reader* and
rebel-readline.jline-api/*service* dynamic vars have to be set for
this to work.
See rebel-readline.main for an example of how this function is normally used
Print a syntax highlighted clojure string. This printer respects the current color settings set in the service. The `rebel-readline.jline-api/*line-reader*` and `rebel-readline.jline-api/*service*` dynamic vars have to be set for this to work. See `rebel-readline.main` for an example of how this function is normally used
(syntax-highlight-prn-unwrapped x)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |