REPL tools.

All of the vars defined here are automatically refered when dunaj REPL is started (when inside dunaj.user namespace), through dunaj.main or through clojure.core/dunaj!.

*1

Available since version 1.0 (view source)

not referred automatically

VAR of type Any

Bound in a repl thread to the most recent value printed.

See also: *2, *3, *e

*2

Available since version 1.0 (view source)

not referred automatically

VAR of type Any

Bound in a repl thread to the second most recent value printed.

See also: *1, *3, *e

*3

Available since version 1.0 (view source)

not referred automatically

VAR of type Any

Bound in a repl thread to the third most recent value printed.

See also: *2, *1, *e

*e

Available since version 1.0 (view source)

not referred automatically

VAR of type (Maybe IException)

Bound in a repl thread to the most recent exception caught by the repl.

See also: *2, *3, *1

apropos

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (apropos str-or-pattern)

Type signature:
  • ((U String+ Regex)) → []

Given a regular expression or stringable thing, return a seq of all public definitions in all currently-loaded namespaces that match the str-or-pattern.

See also: source, doc

demunge

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (demunge fn-name)

Type signature:
  • (String+) → String+

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

dir

Available since version 1.0 (view source)

not referred automatically

MACRO (dir nsname)

Prints a sorted directory of public vars in a namespace

See also: dir-fn

dir-fn

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (dir-fn ns)

Type signature:
  • (Symbol) → []

Returns a sorted seq of symbols naming public vars in a namespace named by ns symbol.

See also: dir

doc

Available since version 1.0 (view source)

not referred automatically

MACRO (doc name)

Prints documentation for a var or namespace given its symbolic name.

See also: find-doc, source, apropos

find-doc

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (find-doc re-string-or-pattern)

Type signature:
  • ((U String+ Regex)) → nil

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

See also: doc, source, apropos

pst

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (pst)

  • (pst e-or-depth)

  • (pst e depth)

Type signatures:
  • () → nil

  • ((U Integer+ IException)) → nil

  • (IException ⨯ Integer+) → nil

Prints a stack trace of the exception e, to the depth requested. If none supplied, uses the root cause of the most recent repl exception (*e), and a depth of 12.

root-cause

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (root-cause t)

Type signature:
  • (IException) → IException

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

source

Available since version 1.0 (view source)

not referred automatically

MACRO (source x)

Prints the source code for the given symbol x, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .clj is in the classpath.

See also: source-fn

source-fn

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (source-fn x)

Type signature:
  • (Symbol) → (Maybe String+)

Returns a string of the source code for the given symbol x, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .clj is in the classpath. Returns nil if it can’t find the source. For most REPL usage, source is more convenient.

See also: source

stack-element-str

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (stack-element-str el)

Type signature:
  • (java.lang.StackTraceElement) → String+

Returns a (possibly unmunged) string representation of a StackTraceElement el.

See also: pst, root-cause, demunge

use!

Available since version 1.0 (alias of clojure.core/use)

not referred automatically

Usage:
  • (use! & args)

Type signature:
  • ((Va Any)) → Any

Like dunaj.lib/require!, but also refers to each lib’s namespace using dunaj.namespace/refer!. Use :use in the ns macro in preference to calling this directly.

use! accepts additional options in libspecs: :exclude, :only, :rename. The arguments and semantics for :exclude, :only, and :rename are the same as those documented for dunaj.namespace/refer!.

See also: dunaj.lib/require!