Skip to main content

REPL & Tooling

  • add-lib

    Given a lib that is not yet on the repl classpath, make it available by downloading the library if necessary and addin...

  • add-libs

    Given lib-coords, a map of lib to coord, will resolve all transitive deps for the libs together and add them to the re...

  • sync-deps

    Calls add-libs with any libs present in deps.edn but not yet present on the classpath. :aliases - coll of alias key...

  • demunge

    Given a string representation of a fn class, as in a stack trace element, returns a readable version.

  • err->msg

    Helper to return an error message string from an exception.

  • ex-str

    Returns a string from exception data, as produced by ex-triage. The first line summarizes the exception phase and loca...

  • ex-triage

    Returns an analysis of the phase, error, cause, and location of an error that occurred based on Throwable data, as ret...

  • load-script

    Loads Clojure source from a file or resource given its path. Paths beginning with @ or @/ are considered relative to c...

  • main

    Usage: java -cp clojure.jar clojure.main [init-opt*] [main-opt] [arg*] With no options or args, runs an interactive R...

  • renumbering-read

    Reads from reader, which must be a LineNumberingPushbackReader, while capturing the read string. If the read is succes...

  • repl

    Generic, reusable, read-eval-print loop. By default, reads from *in*, writes to *out*, and prints exception summaries ...

  • repl-caught

    Default :caught hook for repl

  • repl-exception

    Returns the root cause of throwables

  • repl-prompt

    Default :prompt hook for repl

  • repl-read

    Default :read hook for repl. Reads from *in* which must either be an instance of LineNumberingPushbackReader or duplic...

  • repl-requires

    A sequence of lib specs that are applied to `require` by default when a new command-line REPL is started.

  • report-error

    Create and output an exception report for a Throwable to target. Options: :target - "file" (default), "stderr", "...

  • root-cause

    Returns the initial cause of an exception or error by peeling off all of its wrappers

  • skip-if-eol

    If the next character on stream s is a newline, skips it, otherwise leaves the stream untouched. Returns :line-start, ...

  • skip-whitespace

    Skips whitespace characters on stream s. Returns :line-start, :stream-end, or :body to indicate the relative location ...

  • stack-element-str

    Returns a (possibly unmunged) string representation of a StackTraceElement

  • with-bindings

    Executes body in the context of thread-local bindings for several vars that often need to be set!: *ns* *warn-on-refle...

  • with-read-known

    Evaluates body with *read-eval* set to a "known" value, i.e. substituting true for :unknown if necessary.

  • apropos

    Given a regular expression or stringable thing, return a seq of all public definitions in all currently-loaded namespace...

  • demunge

    Given a string representation of a fn class, as in a stack trace element, returns a readable version.

  • dir

    Prints a sorted directory of public vars in a namespace

  • dir-fn

    Returns a sorted seq of symbols naming public vars in a namespace or namespace alias. Looks for aliases in *ns*

  • doc

    Prints documentation for a var or special form given its name, or for a spec if given a keyword

  • find-doc

    Prints documentation for any var whose documentation or name contains a match for re-string-or-pattern

  • pst

    Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the most recen...

  • root-cause

    Returns the initial cause of an exception or error by peeling off all of its wrappers

  • set-break-handler!

    Register INT signal handler. After calling this, Ctrl-C will cause the given function f to be called with a single ar...

  • source

    Prints the source code for the given symbol, if it can find it. This requires that the symbol resolve to a Var defined...

  • source-fn

    Returns a string of the source code for the given symbol, if it can find it. This requires that the symbol resolve to...

  • stack-element-str

    Returns a (possibly unmunged) string representation of a StackTraceElement

  • thread-stopper

    Returns a function that takes one arg and uses that as an exception message to stop the given thread. Defaults to the...

  • e

    REPL utility. Prints a brief stack trace for the root cause of the most recent exception.

  • print-cause-trace

    Like print-stack-trace but prints chained exceptions (causes).

  • print-stack-trace

    Prints a Clojure-oriented stack trace of tr, a Throwable. Prints a maximum of n stack frames (default: unlimited). D...

  • print-throwable

    Prints the class and message of a Throwable. Prints the ex-data map if present.

  • print-trace-element

    Prints a Clojure-oriented view of one element in a stack trace.

  • root-cause

    Returns the last 'cause' Throwable in a chain of Throwables.