Liking cljdoc? Tell your friends :D

rebel-readline.clojure.main


-mainclj

(-main & args)
source

breakcljmacro

(break)
source

contextual-evalclj

(contextual-eval ctx expr)
source

create-repl-readclj

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)))))
sourceraw docstring

local-contextcljmacro

(local-context)
source

replclj

(repl & opts)
source

repl*clj

(repl* opts)
source

syntax-highlight-prnclj

(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
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close