API for repl-utils
- ()
by Chris Houser, Christophe Grand, Stephen Gilardi, Michel Salim
Full namespace name:
clojure.contrib.repl-utils
Overview
Utilities meant to be used interactively at the REPL
Public Variables and Functions
*local-javadocs*
var
Ref to a list of local paths for Javadoc-generated HTML
files.
Source
*remote-javadocs*
var
Ref to a map from package name prefixes to URLs for remote
Javadocs.
Source
add-break-thread!
function
Usage: (add-break-thread!)
(add-break-thread! t)
Add the given thread to break-threads so that it will be stopped
any time the user presses Ctrl-C. Calls start-handling-break for
you. Adds the current thread if none is given.
Source
add-local-javadoc
function
Usage: (add-local-javadoc path)
Adds to the list of local Javadoc paths.
Source
add-remote-javadoc
function
Usage: (add-remote-javadoc package-prefix url)
Adds to the list of remote Javadoc URLs. package-prefix is the
beginning of the package name that has docs at this URL.
Source
apropos
function
Usage: (apropos str-or-pattern)
Given a regular expression or stringable thing, return a seq of
all definitions in all currently-loaded namespaces that match the
str-or-pattern.
Deprecated since clojure-contrib version 1.2
Source
break-threads
var
Threads to stop when Ctrl-C is pressed. See 'add-break-thread!'
Source
expression-info
function
Usage: (expression-info expr)
Uses the Clojure compiler to analyze the given s-expr. Returns
a map with keys :class and :primitive? indicating what the compiler
concluded about the return value of the expression. Returns nil if
not type info can be determined at compile-time.
Example: (expression-info '(+ (int 5) (float 10)))
Returns: {:class float, :primitive? true}
Source
find-javadoc-url
function
Usage: (find-javadoc-url classname)
Searches for a URL for the given class name. Tries
*local-javadocs* first, then *remote-javadocs*. Returns a string.
Source
get-source
function
Usage: (get-source x)
Returns a string of the source code for the given symbol, 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.
Example: (get-source 'filter)
Deprecated since clojure-contrib version 1.2
Source
javadoc
function
Usage: (javadoc class-or-object)
Opens a browser window displaying the javadoc for the argument.
Tries *local-javadocs* first, then *remote-javadocs*.
Source
run
macro
Usage: (run ns-name & args)
Loads the specified namespace and invokes its "main" function with
optional args. ns-name is not evaluated.
Source
run*
function
Usage: (run* ns-sym & args)
Loads the specified namespace and invokes its "main" function with
optional args.
Source
show
function
Usage: (show x)
(show x selector)
With one arg prints all static and instance members of x or (class x).
Each member is listed with a number which can be given as 'selector'
to return the member object -- the REPL will print more details for
that member.
The selector also may be a string or regex, in which case only
members whose names match 'selector' as a case-insensitive regex
will be printed.
Finally, the selector also may be a predicate, in which case only
members for which the predicate returns true will be printed. The
predicate will be passed a single argument, a map that includes the
:text that will be printed and the :member object itself, as well as
all the properies of the member object as translated by 'bean'.
Examples: (show Integer) (show []) (show String 23) (show String "case")
Source
source
macro
Usage: (source n)
Prints the source code for the given symbol, 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.
Example: (source filter)
Deprecated since clojure-contrib version 1.2
Source
start-handling-break
function
Usage: (start-handling-break)
Register INT signal handler. After calling this, Ctrl-C will cause
all break-threads to be stopped. See 'add-break-thread!'
Source