Generic interactive eval loop. Language-agnostic. All language-specific behavior is injected via opts: :run-fn — (fn [source opts] → ctx-with-:forms) :expand-forms — (fn [forms opts] → expanded-forms) :format-error — (fn [exception input] → error-string) :eval — eval function (default: clojure.core/eval) :read-line — line reader fn (default: read-line) :banner — REPL banner string :reader-opts — opts map passed to run-fn :prelude — vector of forms to eval before REPL loop JVM/Babashka only.
Generic interactive eval loop. Language-agnostic. All language-specific behavior is injected via opts: :run-fn — (fn [source opts] → ctx-with-:forms) :expand-forms — (fn [forms opts] → expanded-forms) :format-error — (fn [exception input] → error-string) :eval — eval function (default: clojure.core/eval) :read-line — line reader fn (default: read-line) :banner — REPL banner string :reader-opts — opts map passed to run-fn :prelude — vector of forms to eval before REPL loop JVM/Babashka only.
(input-state s run-fn)(input-state s run-fn opts)Returns :complete, :incomplete, or :invalid for the given input string. run-fn: (fn [source opts] → ctx-with-:forms)
Returns :complete, :incomplete, or :invalid for the given input string. run-fn: (fn [source opts] → ctx-with-:forms)
(start opts)Start a REPL. All language-specific behavior injected via opts. opts: :run-fn — REQUIRED (fn [source opts] → ctx-with-:forms) :expand-forms — REQUIRED (fn [forms opts] → expanded-forms) :format-error — (fn [exception input] → error-string) :eval — eval fn (default: eval) :read-line — line reader fn (default: read-line) :banner — banner string :reader-opts — opts passed to run-fn :prelude — forms to eval before REPL loop
Start a REPL. All language-specific behavior injected via opts. opts: :run-fn — REQUIRED (fn [source opts] → ctx-with-:forms) :expand-forms — REQUIRED (fn [forms opts] → expanded-forms) :format-error — (fn [exception input] → error-string) :eval — eval fn (default: eval) :read-line — line reader fn (default: read-line) :banner — banner string :reader-opts — opts passed to run-fn :prelude — forms to eval before REPL loop
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 |