首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

clojure.repl

完整名称空间名称:clojure.repl

概述

代码语言:javascript
复制
Utilities meant to be used interactively at the REPL

公共变量和函数

非提议函数

代码语言:javascript
复制
Usage: (apropos str-or-pattern)
代码语言:javascript
复制
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.

demunge函数

代码语言:javascript
复制
Usage: (demunge fn-name)
代码语言:javascript
复制
Given a string representation of a fn class,
as in a stack trace element, returns a readable version.

在Clojure版本1.3中添加

dir

代码语言:javascript
复制
Usage: (dir nsname)
代码语言:javascript
复制
Prints a sorted directory of public vars in a namespace

dir-fn函数

代码语言:javascript
复制
Usage: (dir-fn ns)
代码语言:javascript
复制
Returns a sorted seq of symbols naming public vars in
a namespace

doc

代码语言:javascript
复制
Usage: (doc name)
代码语言:javascript
复制
Prints documentation for a var or special form given its name

在Clojure版本1.0中添加

find-doc函数

代码语言:javascript
复制
Usage: (find-doc re-string-or-pattern)
代码语言:javascript
复制
Prints documentation for any var whose documentation or name
contains a match for re-string-or-pattern

在Clojure版本1.0中添加

pst函数

代码语言:javascript
复制
Usage: (pst)
       (pst e-or-depth)
       (pst e depth)
代码语言:javascript
复制
Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the
most recent repl exception (*e), and a depth of 12.

在Clojure版本1.3中添加

因果函数

代码语言:javascript
复制
Usage: (root-cause t)
代码语言:javascript
复制
Returns the initial cause of an exception or error by peeling off all of
its wrappers

在Clojure版本1.3中添加

set-break-handler 函数

代码语言:javascript
复制
Usage: (set-break-handler!)
       (set-break-handler! f)
代码语言:javascript
复制
Register INT signal handler.  After calling this, Ctrl-C will cause
the given function f to be called with a single argument, the signal.
Uses thread-stopper if no function given.

source宏

代码语言:javascript
复制
Usage: (source n)
代码语言:javascript
复制
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)

source-fn函数

代码语言:javascript
复制
Usage: (source-fn x)
代码语言:javascript
复制
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: (source-fn 'filter)

stack-element-str函数

代码语言:javascript
复制
Usage: (stack-element-str el)
代码语言:javascript
复制
Returns a (possibly unmunged) string representation of a StackTraceElement

在Clojure版本1.3中添加

thread-stopper函数

代码语言:javascript
复制
Usage: (thread-stopper)
       (thread-stopper thread)
代码语言:javascript
复制
Returns a function that takes one arg and uses that as an exception message
to stop the given thread.  Defaults to the current thread

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com