-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathclojure.repl-api.html
More file actions
409 lines (346 loc) · 20.1 KB
/
Copy pathclojure.repl-api.html
File metadata and controls
409 lines (346 loc) · 20.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>clojure.repl - Clojure v1.12.4 API documentation</title>
<link rel="icon" href="static/favicon.png" />
<link rel="shortcut icon" href="static/favicon.png" />
<link rel="stylesheet" href="static/clojure.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/wiki.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/internal.css" type="text/css" media="all" />
<style>.menuWrapper{height: 36px;}</style>
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a href="index.html" id="Logo"><img src="static/clojure-icon.gif" width="100" height="100" alt="Clojure" /></a>
<h1><a href="index.html" id="page-header" title="page header title">Clojure Core API Reference</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<span class="toc-header"><span id="project-name">Clojure</span> <span id="version">v1.12.4</span> API</span><br />
<ul>
<li><a href="index.html" class="wiki_link">Overview</a></li>
<li><a href="api-index.html" class="wiki_link">API Index</a></li>
</ul>
<div class="NamespaceTOC">
<span class="toc-header">Namespaces</span>
<ul id="left-sidebar-list">
<li><a class="wiki_link" href="clojure.core-api.html">clojure.core</a></li><li><a class="wiki_link" href="clojure.data-api.html">clojure.data</a></li><li><a class="wiki_link" href="clojure.datafy-api.html">clojure.datafy</a></li><li><a class="wiki_link" href="clojure.edn-api.html">clojure.edn</a></li><li><a class="wiki_link" href="clojure.inspector-api.html">clojure.inspector</a></li><li><a class="wiki_link" href="clojure.instant-api.html">clojure.instant</a></li><li><a class="wiki_link" href="clojure.java.basis-api.html">clojure.java.basis</a></li><li><a class="wiki_link" href="clojure.java.browse-api.html">clojure.java.browse</a></li><li><a class="wiki_link" href="clojure.java.io-api.html">clojure.java.io</a></li><li><a class="wiki_link" href="clojure.java.javadoc-api.html">clojure.java.javadoc</a></li><li><a class="wiki_link" href="clojure.java.process-api.html">clojure.java.process</a></li><li><a class="wiki_link" href="clojure.java.shell-api.html">clojure.java.shell</a></li><li><a class="wiki_link" href="clojure.main-api.html">clojure.main</a></li><li><a class="wiki_link" href="clojure.math-api.html">clojure.math</a></li><li><a class="wiki_link" href="clojure.pprint-api.html">clojure.pprint</a></li><li><a class="wiki_link" href="clojure.reflect-api.html">clojure.reflect</a></li><li><a class="wiki_link" href="clojure.repl-api.html">clojure.repl</a></li><li><a class="wiki_link" href="clojure.set-api.html">clojure.set</a></li><li><a class="wiki_link" href="clojure.stacktrace-api.html">clojure.stacktrace</a></li><li><a class="wiki_link" href="clojure.string-api.html">clojure.string</a></li><li><a class="wiki_link" href="clojure.template-api.html">clojure.template</a></li><li><a class="wiki_link" href="clojure.test-api.html">clojure.test</a></li><li><a class="wiki_link" href="clojure.tools.deps.interop-api.html">clojure.tools.deps.interop</a></li><li><a class="wiki_link" href="clojure.walk-api.html">clojure.walk</a></li><li><a class="wiki_link" href="clojure.xml-api.html">clojure.xml</a></li><li><a class="wiki_link" href="clojure.zip-api.html">clojure.zip</a></li>
</ul>
</div>
<div class="BranchTOC">
<span class="toc-header">Other Versions</span>
<ul id="left-sidebar-branch-list">
<li><a class="wiki_link" href="index.html">v1.12.3 (stable)</a></li><li><a class="wiki_link" href="branch-master/index.html">v1.13 (in development)</a></li><li><a class="wiki_link" href="branch-clojure-1.11.4/index.html">v1.11.4 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.10.3/index.html">v1.10.3 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.9.0/index.html">v1.9 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.8.0/index.html">v1.8 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.7.0/index.html">v1.7 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.6.0/index.html">v1.6 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.5.0/index.html">v1.5 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.4.0/index.html">v1.4 (legacy)</a></li><li><a class="wiki_link" href="branch-1.3.x/index.html">v1.3 (legacy)</a></li><li><a class="wiki_link" href="branch-1.2.x/index.html">v1.2 (legacy)</a></li><li><a class="wiki_link" href="branch-1.1.x/index.html">v1.1 (legacy)</a></li>
</ul>
</div>
<a class="wiki_link" href="https://clojure.org">Clojure Home</a>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div class="wiki wikiPage" id="content_view">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#toc0">Overview</a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#var-section">Vars and Functions</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/apropos" class="toc-entry-anchor">apropos</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/demunge" class="toc-entry-anchor">demunge</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/dir" class="toc-entry-anchor">dir</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/dir-fn" class="toc-entry-anchor">dir-fn</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/doc" class="toc-entry-anchor">doc</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/find-doc" class="toc-entry-anchor">find-doc</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/pst" class="toc-entry-anchor">pst</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/root-cause" class="toc-entry-anchor">root-cause</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/set-break-handler!" class="toc-entry-anchor">set-break-handler!</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/source" class="toc-entry-anchor">source</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/source-fn" class="toc-entry-anchor">source-fn</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/stack-element-str" class="toc-entry-anchor">stack-element-str</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl/thread-stopper" class="toc-entry-anchor">thread-stopper</a>
</div>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#clojure.repl.deps">clojure.repl.deps</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl.deps/add-lib" class="toc-entry-anchor">add-lib</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl.deps/add-libs" class="toc-entry-anchor">add-libs</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.repl.deps/sync-deps" class="toc-entry-anchor">sync-deps</a>
</div>
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="clojure.repl">clojure.repl</span>
- <span id="header-project">Clojure</span> <span id="header-version">v1.12.4</span><span id="header-status-block"> (<span id="header-status">stable</span>)</span>
</h1>
<span id="author-line">by <span id="author-name">Chris Houser, Christophe Grand, Stephen Gilardi, Michel Salim</span><br /></span>
<br />Full namespace name: <span id="long-name">clojure.repl</span>
<p></p>
<h2>Overview</h2>
<pre id="namespace-docstr">Utilities meant to be used interactively at the REPL</pre>
<br />
<div id="var-section">
<p></p>
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/apropos">apropos</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (apropos str-or-pattern)
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L181">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/demunge">demunge</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (demunge fn-name)
</pre>
<pre id="var-docstr">Given a string representation of a fn class,
as in a stack trace element, returns a readable version.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.3</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L207">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/dir">dir</h2>
<span id="var-type">macro</span><br />
<pre id="var-usage">Usage: (dir nsname)
</pre>
<pre id="var-docstr">Prints a sorted directory of public vars in a namespace</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L201">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/dir-fn">dir-fn</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (dir-fn ns)
</pre>
<pre id="var-docstr">Returns a sorted seq of symbols naming public vars in
a namespace or namespace alias. Looks for aliases in *ns*</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L195">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/doc">doc</h2>
<span id="var-type">macro</span><br />
<pre id="var-usage">Usage: (doc name)
</pre>
<pre id="var-docstr">Prints documentation for a var or special form given its name,
or for a spec if given a keyword</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.0</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L131">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/find-doc">find-doc</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (find-doc re-string-or-pattern)
</pre>
<pre id="var-docstr">Prints documentation for any var whose documentation or name
contains a match for re-string-or-pattern</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.0</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L115">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/pst">pst</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (pst)
(pst e-or-depth)
(pst e depth)
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.3</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L240">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/root-cause">root-cause</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (root-cause t)
</pre>
<pre id="var-docstr">Returns the initial cause of an exception or error by peeling off all of
its wrappers</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.3</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L214">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/set-break-handler!">set-break-handler!</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (set-break-handler!)
(set-break-handler! f)
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L279">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/source">source</h2>
<span id="var-type">macro</span><br />
<pre id="var-usage">Usage: (source n)
</pre>
<pre id="var-docstr">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)</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L172">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/source-fn">source-fn</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (source-fn x)
</pre>
<pre id="var-docstr">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)</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L147">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/stack-element-str">stack-element-str</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (stack-element-str el)
</pre>
<pre id="var-docstr">Returns a (possibly unmunged) string representation of a StackTraceElement</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.3</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L227">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl/thread-stopper">thread-stopper</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (thread-stopper)
(thread-stopper thread)
</pre>
<pre id="var-docstr">Returns a function that takes one arg and uses that as an exception message
to stop the given thread. Defaults to the current thread</pre>
<pre id="var-specs"></pre>
<a id="var-source" href="https://github.com/clojure/clojure/blob/3b6256e654bf250ddfd01cdaa4be9f39a74c2de6/src/clj/clojure/repl.clj#L273">Source</a>
</div>
</div>
<br />
<h2 id="clojure.repl.deps">clojure.repl.deps</h2>
<pre id="namespace-docstr">clojure.repl.deps provides facilities for dynamically modifying the available
libraries in the runtime when running at the REPL, without restarting</pre>
<br />
<div id="var-section">
<p></p>
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl.deps/add-lib">add-lib</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (add-lib lib coord)
(add-lib lib)
</pre>
<pre id="var-docstr">Given a lib that is not yet on the repl classpath, make it available by
downloading the library if necessary and adding it to the classloader.
Libs already on the classpath are not updated. Requires a valid parent
DynamicClassLoader.
lib - symbol identifying a library, for Maven: groupId/artifactId
coord - optional map of location information specific to the procurer,
or latest if not supplied
Returns coll of libs loaded, including transitive (or nil if none).
For info on libs, coords, and versions, see:
<a href="https://clojure.org/reference/deps_and_cli">https://clojure.org/reference/deps_and_cli</a></pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/be32516234961396581685b485ed8a88f8fe17e6/src/clj/clojure/repl/deps.clj#L59">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl.deps/add-libs">add-libs</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (add-libs lib-coords)
</pre>
<pre id="var-docstr">Given lib-coords, a map of lib to coord, will resolve all transitive deps for the libs
together and add them to the repl classpath, unlike separate calls to add-lib.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/be32516234961396581685b485ed8a88f8fe17e6/src/clj/clojure/repl/deps.clj#L35">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.repl.deps/sync-deps">sync-deps</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (sync-deps & {:as opts})
</pre>
<pre id="var-docstr">Calls add-libs with any libs present in deps.edn but not yet present on the classpath.
:aliases - coll of alias keywords to use during the sync</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/be32516234961396581685b485ed8a88f8fe17e6/src/clj/clojure/repl/deps.clj#L85">Source</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div id="copyright" style="text-align: center;">Copyright 2007-2025 by Rich Hickey</div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a href="http://www.tomhickey.com" title="Visit Tom Hickey's website.">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>