CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 20 Aug 2025 11:34:25 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20091001035543
location: https://web.archive.org/web/20091001035543/https://richhickey.github.com/clojure-contrib/
server-timing: captures_list;dur=0.711042, exclusion.robots;dur=0.025833, exclusion.robots.policy;dur=0.011601, esindex;dur=0.014767, cdx.remote;dur=5.327666, LoadShardBlock;dur=438.271679, PetaboxLoader3.datanode;dur=104.275208, PetaboxLoader3.resolve;dur=258.063862
x-app-server: wwwb-app219
x-ts: 302
x-tr: 471
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app219; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 20 Aug 2025 11:34:25 GMT
content-type: text/html
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Thu, 01 Oct 2009 03:55:42 GMT
x-archive-orig-content-length: 150001
x-archive-orig-last-modified: Mon, 31 Aug 2009 09:56:12 GMT
x-archive-orig-connection: close
x-archive-orig-expires: Fri, 02 Oct 2009 03:55:42 GMT
x-archive-orig-cache-control: max-age=86400
x-archive-orig-accept-ranges: bytes
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 01 Oct 2009 03:55:43 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 07 Aug 2009 11:18:57 GMT", ; rel="prev memento"; datetime="Tue, 01 Sep 2009 01:35:40 GMT", ; rel="memento"; datetime="Thu, 01 Oct 2009 03:55:43 GMT", ; rel="next memento"; datetime="Sat, 05 Dec 2009 04:22:43 GMT", ; rel="last memento"; datetime="Thu, 01 Jun 2023 04:23:47 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_12_20091001010305_crawl102.gpg-c/51_12_20091001035517_crawl101.arc.gz
server-timing: captures_list;dur=0.635467, exclusion.robots;dur=0.023821, exclusion.robots.policy;dur=0.011439, esindex;dur=0.014288, cdx.remote;dur=6.583767, LoadShardBlock;dur=99.100629, PetaboxLoader3.datanode;dur=102.794096, PetaboxLoader3.resolve;dur=112.288520, load_resource;dur=163.461914
x-app-server: wwwb-app219
x-ts: 200
x-tr: 412
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Clojure Contrib - Overview
The user contributions library, clojure.contrib, is a collection of namespaces each of which implements features that we believe may be useful to a large part of the clojure community.
This library was created by Rich Hickey but has been populated and is maintained by a group of volunteers who are excited about the success of the Clojure language and want to do our part to help it along. The current list of contributors is available on the clojure-contrib GitHub source page.
More contributions (and contributors) are welcome. If you wish to contribute, you will need to sign a contributor agreement (which allows Clojure and clojure.contrib to proceed without entanglements, see contributing for more info).
The best way to start is to share a project you've written with the google group and gauge the interest in adding it to contrib. (Publishing it in an open source form on google code, github or some other easy-to-access place in the net will also help.) After general discussion, Rich Hickey makes the final determination about what gets added to clojure.contrib.
Some parts of clojure.contrib may migrate into clojure.core if they prove to be so generally useful that they justify being everywhere. (For example, condp started out as an extension in contrib, but was moved to core by popular acclamation.)
The exact role of clojure.contrib and the future of the Clojure environment (standard libraries, dependency models, packaging systems, etc.) is the subject of pretty much continuous discussion in the clojure google group and in #clojure on freenode. Feel free to join that discussion and help shape the ways Clojure is extended.
Like Clojure itself, clojure.contrib is made available under the Eclipse Public License (EPL). clojure.contrib is copyright 2008-2009 Rich Hickey and the various contributors.
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Variables and functions in datalog.database: add-index add-relation add-tuple add-tuples any-match? database-counts database-merge database-merge-parallel datalog-relation ensure-relation get-relation make-database merge-relations remove-tuple replace-relation select
Variables and functions in datalog.literals: adorned-literal build-atom build-literal build-seed-bindings delta-literal display-literal get-adorned-bindings get-base-predicate get-cs-from-vs get-self-bound-cs get-vs-from-cs join-literal literal-appropriate? literal-columns literal-magic? literal-predicate literal-vars magic-literal negated-literal negated? negative-vars positive-vars positive? project-literal
Variables and functions in datalog.magic: adorn-query adorn-rules-set build-partial-tuple magic-transform seed-predicate-for-insertion seed-relation seed-rule
Variables and functions in datalog.rules: <- ?- all-predicates apply-rule compute-sip display-query display-rule is-safe? make-rules-set non-base-rules predicate-map return-rule-data rules-set
Variables and functions in datalog.softstrat: build-soft-strat-work-plan get-all-relations
Variables and functions in datalog.util: is-query-var? is-var? keys-to-vals map-values preduce reverse-map trace-datalog
Detailed API documentation
Public variables and functions: defalias defhinted defmacro- defn-memo defnk defonce- defstruct- defunbound defunbound- defvar defvar- name-with-attributes
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Public variables and functions: as-file as-properties as-str as-url file get-system-property read-properties relative-path-string set-system-properties with-system-properties write-properties
Detailed API documentation
Detailed API documentation
Detailed API documentation
Public variables and functions: *json-keyword-keys* read-json
Detailed API documentation
Public variables and functions: json-str print-json
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Variables and functions in miglayout.example: converter-ui fahrenheit main
Variables and functions in miglayout.internal: add-components component? constraint? do-layout format-constraint format-constraints get-components parse-component-constraint parse-item-constraints
Variables and functions in miglayout.test: label sep text-field
Detailed API documentation
Detailed API documentation
Public variables and functions: calls expect has-args has-matching-signature? make-arg-checker make-count-checker make-mock returns times validate-counts
Variables and functions in mock.test-adapter: calls has-args has-matching-signature? make-arg-checker make-count-checker make-mock report-problem returns times validate-counts
Detailed API documentation
Detailed API documentation
Public variables and functions: call-cc cont-m defmonad defmonadfn domonad fetch-state fetch-val identity-m m-chain m-fmap m-join m-lift m-map m-reduce m-seq m-until m-when m-when-not maybe-m maybe-t monad monad-transformer run-cont sequence-m sequence-t set-m set-state set-val state-m state-m-until state-t update-state update-val with-monad with-state-field writer-m
Detailed API documentation
Detailed API documentation
Variables and functions in pprint.examples.json: dispatch-json json-str print-json
Variables and functions in pprint.examples.xml: *html-compatible* *prxml-indent* prxml
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Public variables and functions: connection create-table delete-rows do-commands do-prepared drop-table find-connection insert-records insert-rows insert-values is-rollback-only set-rollback-only transaction update-or-insert-values update-values with-connection with-query-results
Variables and functions in sql.internal: connection* find-connection* get-connection print-sql-exception print-sql-exception-chain print-update-counts rollback throw-rollback transaction* with-connection* with-query-results*
Variables and functions in sql.test: create-fruit db-batchupdate-exception db-exception db-get-tables db-grade-a db-grade-range db-read db-read-all db-rollback db-sql-exception db-update db-update-appearance-cost db-update-or-insert db-write drop-fruit insert-records-fruit insert-rows-fruit insert-values-fruit
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Public variables and functions: action-translation-table add-action-listener add-key-typed-listener add-menu-item do-swing do-swing* do-swing-and-wait make-action make-menubar menu-constructor-dispatch
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Detailed API documentation
Variables and functions in zip-filter.xml: attr attr= seq-test tag= text text= xml-> xml1->
Overview
API Index
Namespaces:
API Index
Namespaces:
- accumulators
- agent-utils
- base64
- classpath
- combinatorics
- command-line
- complex-numbers
- cond
- condition
- core
- dataflow
- datalog
- def
- duck-streams
- error-kit
- except
- fcase
- find-namespaces
- fnmap
- gen-html-docs
- generic.arithmetic
- generic.collection
- generic.comparison
- generic.functor
- generic.math-functions
- graph
- greatest-least
- http.agent
- http.connection
- import-static
- jar
- java-utils
- javadoc.browse
- jmx
- json.read
- json.write
- lazy-seqs
- lazy-xml
- logging
- macro-utils
- macros
- map-utils
- math
- miglayout
- mmap
- mock
- monadic-io-streams
- monads
- ns-utils
- pprint
- probabilities.finite-distributions
- probabilities.monte-carlo
- probabilities.random-numbers
- profile
- prxml
- repl-ln
- repl-utils
- seq-utils
- server-socket
- set
- shell-out
- singleton
- sql
- str-utils
- str-utils2
- stream-utils
- swing-utils
- test-is
- trace
- types
- with-ns
- zip-filter
Table of Contents
An Overview of clojure.contrib
The user contributions library, clojure.contrib, is a collection of namespaces each of which implements features that we believe may be useful to a large part of the clojure community.
This library was created by Rich Hickey but has been populated and is maintained by a group of volunteers who are excited about the success of the Clojure language and want to do our part to help it along. The current list of contributors is available on the clojure-contrib GitHub source page.
More contributions (and contributors) are welcome. If you wish to contribute, you will need to sign a contributor agreement (which allows Clojure and clojure.contrib to proceed without entanglements, see contributing for more info).
The best way to start is to share a project you've written with the google group and gauge the interest in adding it to contrib. (Publishing it in an open source form on google code, github or some other easy-to-access place in the net will also help.) After general discussion, Rich Hickey makes the final determination about what gets added to clojure.contrib.
Some parts of clojure.contrib may migrate into clojure.core if they prove to be so generally useful that they justify being everywhere. (For example, condp started out as an extension in contrib, but was moved to core by popular acclamation.)
The exact role of clojure.contrib and the future of the Clojure environment (standard libraries, dependency models, packaging systems, etc.) is the subject of pretty much continuous discussion in the clojure google group and in #clojure on freenode. Feel free to join that discussion and help shape the ways Clojure is extended.
Like Clojure itself, clojure.contrib is made available under the Eclipse Public License (EPL). clojure.contrib is copyright 2008-2009 Rich Hickey and the various contributors.
Important clojure-contrib resources
- The official source code for clojure-contrib is on the clojure-contrib GitHub source page .
- Issues and other information for clojure-contrib are maintained in the clojure-contrib Assembla space .
- This documentation is maintained in the gh-pages branch of clojure-contrib on GitHub and is always available online GitHub pages for clojure-contrib . If you wish to have a version for off-line use you can use the download button on the gh-pages branch page at GitHub .
- Issues related to clojure-contrib and the various pieces of functionality within it are discussed in the Clojure Google group .
- Discussions among clojure-contrib developers take place in the Clojure Dev Google group .
accumulators
by Konrad HinsenDetailed API documentation
A generic accumulator interface and implementations of various accumulators.Public variables and functions: add add-items combine empty-counter empty-counter-with-total empty-list empty-map empty-maximum empty-mean-variance empty-min-max empty-minimum empty-product empty-queue empty-set empty-string empty-sum empty-tuple empty-vector
agent-utils
by Christophe GrandeDetailed API documentation
Miscellaneous agent utilities (note to other contrib members: feel free to add to this lib)Public variables and functions: capture-and-send
base64
by Stuart SierraDetailed API documentation
Base-64 encoding and (maybe later) decoding. This is mainly here as an example. It is much slower than the Apache Commons Codec implementation or sun.misc.BASE64Encoder.Public variables and functions: encode encode-str
classpath
by Stuart SierraDetailed API documentation
Utilities for dealing with the JVM's classpathPublic variables and functions: classpath classpath-directories classpath-jarfiles
combinatorics
by Mark EngelbergDetailed API documentation
Efficient, functional algorithms for generating lazy sequences for common combinatorial functions. (See the source code for a longer description.)Public variables and functions: cartesian-product combinations lex-permutations permutations selections subsets
command-line
by Chris HouserDetailed API documentation
Process command-line arguments according to a given cmdspecPublic variables and functions: with-command-line
complex-numbers
by Konrad HinsenDetailed API documentation
Complex numbers NOTE: This library is in evolution. Most math functions are not implemented yet.Public variables and functions:
cond
by Stephen C. GilardiDetailed API documentation
Extensions to the basic cond function.Public variables and functions: cond-let
condition
by Stephen C. GilardiDetailed API documentation
Flexible raising and handling of conditions: Functions: raise: raises a condition handler-case: dispatches raised conditions to appropriate handlers print-stack-trace: prints abbreviated or full condition stack traces Data: A condition is a map containing values for these keys: - :type, a condition type specifier, typically a keyword - :stack-trace, a stack trace to the site of the raise - :message, a human-readable message (optional) - :cause, a wrapped exception or condition (optional) - other keys given as arguments to raise (optional) Note: requires AOT compilation. Based on an idea from Chouser: https://groups.google.com/group/clojure/browse_frm/thread/da1285c538f22bb5Public variables and functions: *full-stack-traces* handler-case print-stack-trace raise stack-trace-info
core
by Laurent Petit (and others)Detailed API documentation
Functions/macros variants of the ones that can be found in clojure.core (note to other contrib members: feel free to add to this lib)Public variables and functions: -?> .?. dissoc-in new-by-name seqable?
dataflow
by Jeffrey StraszheimDetailed API documentation
A library to support a dataflow model of statePublic variables and functions: add-cell-watcher add-cells build-dataflow build-source-cell build-standard-cell build-validator-cell cell display-cell eval-cell get-cell get-cells get-old-value get-source-cells get-value get-value-from-cell get-values print-dataflow remove-cells source-cell? update-values
datalog
by Jeffrey StraszheimDetailed API documentation
A Clojure implementation of DatalogPublic variables and functions: build-work-plan run-work-plan
Variables and functions in datalog.database: add-index add-relation add-tuple add-tuples any-match? database-counts database-merge database-merge-parallel datalog-relation ensure-relation get-relation make-database merge-relations remove-tuple replace-relation select
Variables and functions in datalog.literals: adorned-literal build-atom build-literal build-seed-bindings delta-literal display-literal get-adorned-bindings get-base-predicate get-cs-from-vs get-self-bound-cs get-vs-from-cs join-literal literal-appropriate? literal-columns literal-magic? literal-predicate literal-vars magic-literal negated-literal negated? negative-vars positive-vars positive? project-literal
Variables and functions in datalog.magic: adorn-query adorn-rules-set build-partial-tuple magic-transform seed-predicate-for-insertion seed-relation seed-rule
Variables and functions in datalog.rules: <- ?- all-predicates apply-rule compute-sip display-query display-rule is-safe? make-rules-set non-base-rules predicate-map return-rule-data rules-set
Variables and functions in datalog.softstrat: build-soft-strat-work-plan get-all-relations
Variables and functions in datalog.util: is-query-var? is-var? keys-to-vals map-values preduce reverse-map trace-datalog
def
by unknown authorDetailed API documentation
Public variables and functions: defalias defhinted defmacro- defn-memo defnk defonce- defstruct- defunbound defunbound- defvar defvar- name-with-attributes
duck-streams
by Stuart SierraDetailed API documentation
This file defines "duck-typed" I/O utility functions for Clojure. The 'reader' and 'writer' functions will open and return an instance of java.io.BufferedReader and java.io.PrintWriter, respectively, for a variety of argument types -- filenames as strings, URLs, java.io.File's, etc. 'reader' even works on http URLs. Note: this is not really "duck typing" as implemented in languages like Ruby. A better name would have been "do-what-I-mean-streams" or "just-give-me-a-stream", but ducks are funnier.Public variables and functions: *append-to-writer* *buffer-size* *byte-array-type* *default-encoding* append-spit append-writer copy file-str make-parents pwd read-lines reader slurp* spit to-byte-array with-in-reader with-out-append-writer with-out-writer write-lines writer
error-kit
by Chris HouserDetailed API documentation
EXPERIMENTAL System for defining and using custom errors Please contact Chouser if you have any suggestions for better names or API adjustments.Public variables and functions: bind-continue deferror do-not-handle error handle raise raise* throw-msg with-handler
except
by Stephen C. GilardiDetailed API documentation
Provides functions that make it easy to specify the class, cause, and message when throwing an Exception or Error. The optional message is formatted using clojure.core/format.Public variables and functions: throw-arg throw-if throw-if-not throwf
fcase
by Stuart SierraDetailed API documentation
This file defines a generic "case" macro called "fcase" which takes the equality-testing function as an argument. It also defines a traditional "case" macro that tests using "=" and variants that test for regular expressions and class membership. Note (December 23, 2008): This library has been supplanted by the inclusion of "condp" in clojure.core as of Clojure SVN rev. 1180.Public variables and functions: case fcase in-case instance-case re-case
find-namespaces
by Stuart SierraDetailed API documentation
Search for ns declarations in dirs, JARs, or CLASSPATHPublic variables and functions: clojure-source-file? clojure-sources-in-jar comment? find-clojure-sources-in-dir find-namespaces-in-dir find-namespaces-in-jarfile find-namespaces-on-classpath find-ns-decls-in-dir find-ns-decls-in-jarfile find-ns-decls-on-classpath ns-decl? read-file-ns-decl read-ns-decl read-ns-decl-from-jarfile-entry
fnmap
by Stuart SierraDetailed API documentation
Maps that dispatch get/assoc to user-defined functions. Note: requires AOT-compilationPublic variables and functions: fnmap
gen-html-docs
by Craig AnderaDetailed API documentation
Generates a single HTML page that contains the documentation for one or more Clojure libraries.Public variables and functions: generate-documentation generate-documentation-to-file
generic.arithmetic
by Konrad HinsenDetailed API documentation
Generic arithmetic interface This library defines generic versions of + - * / as multimethods that can be defined for any type. The minimal required implementations for a type are binary + and * plus unary - and /. Everything else is derived from these automatically. Explicit binary definitions for - and / can be provided for efficiency reasons.Public variables and functions: * + - / defmethod* qsym
generic.collection
by Konrad HinsenDetailed API documentation
Generic arithmetic interface This library defines generic versions of common collection-related functions as multimethods that can be defined for any type.Public variables and functions: assoc conj dissoc empty get into seq
generic.comparison
by Konrad HinsenDetailed API documentation
Generic comparison interface This library defines generic versions of = < > <= >= zero? as multimethods that can be defined for any type. Of the greater/less-than relations, types must minimally implement >.Public variables and functions: < <= = > >= zero?
generic.functor
by Konrad HinsenDetailed API documentation
Generic functor interface (fmap)Public variables and functions: fmap
generic.math-functions
by Konrad HinsenDetailed API documentation
Generic math function interface This library defines generic versions of common mathematical functions such as sqrt or sin as multimethods that can be defined for any type.Public variables and functions: abs acos approx= asin atan atan2 ceil conjugate cos exp floor log pow rint round sgn sin sqr sqrt tan
graph
by Jeffrey StraszheimDetailed API documentation
Basic graph theory algorithmsPublic variables and functions: add-loops component-graph dependency-list fixed-point get-neighbors lazy-walk post-ordered-nodes recursive-component? remove-loops reverse-graph scc self-recursive-sets stratification-list transitive-closure
greatest-least
by Vincent FoleyDetailed API documentation
Various functions for finding greatest and least values in a collectionPublic variables and functions: all-greatest all-greatest-by all-least all-least-by greatest greatest-by least least-by
http.agent
by Stuart SierraDetailed API documentation
Agent-based asynchronous HTTP client. This is a HTTP client library based on Java's HttpURLConnection class and Clojure's Agent system. It allows you to make multiple HTTP requests in parallel. Start an HTTP request with the 'http-agent' function, which immediately returns a Clojure Agent. You will never deref this agent; that is handled by the accessor functions. The agent will execute the HTTP request on a separate thread. If you pass a :handler function to http-agent, that function will be called as soon as the HTTP response body is ready. The handler function is called with one argument, the HTTP agent itself. The handler can read the response body by calling the 'stream' function on the agent. The value returned by the handler function becomes part of the state of the agent, and you can retrieve it with the 'result' function. If you call 'result' before the HTTP request has finished, it will block until the handler function returns. If you don't provide a handler function, the default handler will buffer the entire response body in memory, which you can retrieve with the 'bytes', 'string', or 'stream' functions. Like 'result', these functions will block until the HTTP request is completed. If you want to check if an HTTP request is finished without blocking, use the 'done?' function. A single GET request could be as simple as: (string (http-agent "https://www.stuartsierra.com/")) A simple POST might look like: (http-agent "http..." :method "POST" :body "foo=1") And you could write the response directly to a file like this: (require '[clojure.contrib.duck-streams :as d]) (http-agent "http..." :handler (fn [agnt] (with-open [w (d/writer "/tmp/out")] (d/copy (stream agnt) w))))Public variables and functions: buffer-bytes bytes client-error? done? error? headers headers-seq http-agent message method redirect? request-body request-headers request-uri result server-error? status stream string success?
http.connection
by unknown authorDetailed API documentation
Low-level HTTP client API around HttpURLConnectionPublic variables and functions: http-connection send-request-entity
import-static
by Stuart SierraDetailed API documentation
Import static Java methods/fields into ClojurePublic variables and functions: import-static
jar
by Stuart SierraDetailed API documentation
Utilities for working with Java JAR filesPublic variables and functions: filenames-in-jar jar-file?
java-utils
by unknown authorDetailed API documentation
Public variables and functions: as-file as-properties as-str as-url file get-system-property read-properties relative-path-string set-system-properties with-system-properties write-properties
javadoc.browse
by Christophe GrandDetailed API documentation
Start a web browser from ClojurePublic variables and functions: open-url-in-browser open-url-in-swing
jmx
by Stuart HallowayDetailed API documentation
JMX support for Clojure Requires post-Clojure 1.0 git edge for clojure.test, clojure.backtrace. This is prerelease. This API will change. Send reports to stu@thinkrelevance.com. Usage (require '[clojure.contrib.jmx :as jmx]) What beans do I have? (jmx/mbean-names "*:*") -> #<HashSet [java.lang:type=MemoryPool,name=CMS Old Gen, java.lang:type=Memory, ...] What attributes does a bean have? (jmx/attribute-names "java.lang:type=Memory") -> (:Verbose :ObjectPendingFinalizationCount :HeapMemoryUsage :NonHeapMemoryUsage) What is the value of an attribute? (jmx/read "java.lang:type=Memory" :ObjectPendingFinalizationCount) -> 0 Can't I just have *all* the attributes in a Clojure map? (jmx/mbean "java.lang:type=Memory") -> {:NonHeapMemoryUsage {:used 16674024, :max 138412032, :init 24317952, :committed 24317952}, :HeapMemoryUsage {:used 18619064, :max 85393408, :init 0, :committed 83230720}, :ObjectPendingFinalizationCount 0, :Verbose false} Can I find and invoke an operation? (jmx/operation-names "java.lang:type=Memory") -> (:gc) (jmx/invoke "java.lang:type=Memory" :gc) -> nil What about some other process? Just run *any* of the above code inside a with-connection: (jmx/with-connection {:host "localhost", :port 3000} (jmx/mbean "java.lang:type=Memory")) -> {:ObjectPendingFinalizationCount 0, :HeapMemoryUsage ... etc.} Can I serve my own beans? Sure, just drop a Clojure ref into an instance of clojure.contrib.jmx.Bean, and the bean will expose read-only attributes for every key/value pair in the ref: (jmx/register-mbean (Bean. (ref {:string-attribute "a-string"})) "my.namespace:name=Value")Public variables and functions: *connection* as-object-name attribute-info attribute-names build-attribute-info guess-attribute-typename jmx->clj jmx-url map->attribute-infos maybe-atomize maybe-keywordize mbean mbean-names op-param-types operation operation-names operations raw-read read read-exceptions read-supported readable? with-connection
json.read
by Stuart SierraDetailed API documentation
JavaScript Object Notation (JSON) parser For more information on JSON, see https://www.json.org/ This library parses data in JSON format. This is a fairly strict implementation of JSON as described at json.org, not a full-fledged JavaScript parser. JavaScript functions and object constructors are not supported. Object field names must be quoted strings; they may not be bare symbols. If you want to convert map keys from strings to keywords, use clojure.contrib.walk/keywordize-keysSee also: JSON Home Page
Public variables and functions: *json-keyword-keys* read-json
json.write
by Stuart SierraDetailed API documentation
JavaScript Object Notation (JSON) generator. This library will generate JSON from the following types: * nil * all primitives (Boolean, Byte, Short, Integer, Long, Float, Double) * String (actually any CharSequence) * java.util.Map (including Clojure maps) * java.util.Collection (including Clojure vectors, lists, and sets) * Java arrays You can extend this library to handle new types by adding methods to print-json. This library does NOT attempt to preserve round-trip equality between JSON and Clojure data types. That is, if you write a JSON string with this library, then read it back with clojure.contrib.json.read, you won't necessarily get the exact same data structure. For example, Clojure sets are written as JSON arrays, which will be read back as Clojure vectors. If you want indented output, try the clojure-json library at https://github.com/danlarkin/clojure-json This implementation attempts to follow the description of JSON at <https://json.org/>. Maps become JSON objects, all other collections become JSON arrays. JSON object keys are always converted to strings. Within strings, all non-ASCII characters are hexadecimal escaped.See also: JSON Home Page
Public variables and functions: json-str print-json
lazy-seqs
by Stephen C. GilardiDetailed API documentation
==== Lazy sequences ==== primes - based on the "naive" implemention described in [1] plus a small "wheel" which eliminates multiples of 2, 3, 5, and 7 from consideration by incrementing past them. Also inspired by code from Christophe Grand in [2]. fibs - all the Fibonacci numbers powers-of-2 - all the powers of 2 ==== Lazy sequence functions ==== (rotations, partition-all, shuffle, rand-elt moved to seq_utils.clj) (permutations and combinations moved to combinatorics.clj) [1] https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf [2] https://clj-me.blogspot.com/2008/06/primes.htmlPublic variables and functions: fibs powers-of-2 primes
lazy-xml
by Chris HouserDetailed API documentation
Functions to parse xml lazily and emit back to text.Public variables and functions: emit emit-element parse-seq parse-trim
logging
by Alex Taggart, Timothy PratleyDetailed API documentation
Logging macros which delegate to a specific logging implementation. At macro-expansion-time a specific implementation is selected from, in order, Apache commons-logging, log4j, and finally java.util.logging. Logging levels are specified by clojure keywords corresponding to the values used in log4j and commons-logging: :trace, :debug, :info, :warn, :error, :fatal Logging occurs with the log macro, or the level-specific convenience macros, which write either directly or via an agent. For performance reasons, direct logging is enabled by default, but setting the *allow-direct-logging* boolean atom to false will disable it. If logging is invoked within a transaction it will always use an agent. The log macros will not evaluate their 'message' unless the specific logging level is in effect. Alternately, you can use the spy macro when you have code that needs to be evaluated, and also want to output the code and its result to the debug log. Unless otherwise specified, the current namespace (as identified by *ns*) will be used as the log-ns (similar to how the java class name is usually used). Note: your log configuration should display the name that was passed to the logging implementation, and not perform stack-inspection, otherwise you'll see something like "fn__72$impl_write_BANG__39__auto____81" in your logs. Use the enabled? macro to write conditional code against the logging level (beyond simply whether or not to call log, which is handled automatically). You can redirect all java writes of System.out and System.err to the log system by calling log-capture!. To rebind *out* and *err* to the log system invoke with-logs. In both cases a log-ns (e.g., "com.example.captured") needs to be specified to namespace the output.Public variables and functions: *allow-direct-logging* *impl-name* *logging-agent* agent-write! debug enabled? error fatal impl-enabled? impl-get-log impl-write! info log log-capture! log-stream log-uncapture! spy trace warn with-logs
macro-utils
by Konrad HinsenDetailed API documentation
Local macros and symbol macros Local macros are defined by a macrolet form. They are usable only inside its body. Symbol macros can be defined globally (defsymbolmacro) or locally (symbol-macrolet). A symbol macro defines a form that replaces a symbol during macro expansion. Function arguments and symbols bound in let forms are not subject to symbol macro expansion. Local macros are most useful in the definition of the expansion of another macro, they may be used anywhere. Global symbol macros can be used only inside a with-symbol-macros form.Public variables and functions: defsymbolmacro deftemplate macrolet mexpand mexpand-1 mexpand-all symbol-macrolet with-symbol-macros
macros
by Konrad HinsenDetailed API documentation
Various small macrosPublic variables and functions: const letfn-
map-utils
by Jason Wolfe, Chris HouserDetailed API documentation
Utilities for operating on Clojure maps.Public variables and functions: deep-merge-with lazy-get safe-get safe-get-in
math
by Mark EngelbergDetailed API documentation
Math functions that deal intelligently with the various types in Clojure's numeric tower, as well as math functions commonly found in Scheme implementations. expt - (expt x y) is x to the yth power, returns an exact number if the base is an exact number, and the power is an integer, otherwise returns a double. abs - (abs n) is the absolute value of n gcd - (gcd m n) returns the greatest common divisor of m and n lcm - (lcm m n) returns the least common multiple of m and n The behavior of the next three functions on doubles is consistent with the behavior of the corresponding functions in Java's Math library, but on exact numbers, returns an integer. floor - (floor n) returns the greatest integer less than or equal to n. If n is an exact number, floor returns an integer, otherwise a double. ceil - (ceil n) returns the least integer greater than or equal to n. If n is an exact number, ceil returns an integer, otherwise a double. round - (round n) rounds to the nearest integer. round always returns an integer. round rounds up for values exactly in between two integers. sqrt - Implements the sqrt behavior I'm accustomed to from PLT Scheme, specifically, if the input is an exact number, and is a square of an exact number, the output will be exact. The downside is that for the common case (inexact square root), some extra computation is done to look for an exact square root first. So if you need blazingly fast square root performance, and you know you're just going to need a double result, you're better off calling java's Math/sqrt, or alternatively, you could just convert your input to a double before calling this sqrt function. If Clojure ever gets complex numbers, then this function will need to be updated (so negative inputs yield complex outputs). exact-integer-sqrt - Implements a math function from the R6RS Scheme standard. (exact-integer-sqrt k) where k is a non-negative integer, returns [s r] where k = s^2+r and k < (s+1)^2. In other words, it returns the floor of the square root and thePublic variables and functions: abs ceil exact-integer-sqrt expt floor gcd lcm round sqrt
miglayout
by Stephen C. GilardiDetailed API documentation
Clojure support for the MiGLayout layout manager https://www.miglayout.com/ Example: (use '[clojure.contrib.miglayout.test :as mlt :only ()]) (dotimes [i 5] (mlt/run-test i))Public variables and functions: components miglayout
Variables and functions in miglayout.example: converter-ui fahrenheit main
Variables and functions in miglayout.internal: add-components component? constraint? do-layout format-constraint format-constraints get-components parse-component-constraint parse-item-constraints
Variables and functions in miglayout.test: label sep text-field
mmap
by Chris HouserDetailed API documentation
Functions for memory-mapping files, plus some functions that use a mmaped file for "normal" activies -- slurp, load-file, etc.Public variables and functions: buffer-stream mmap slurp
mock
by unknown authorDetailed API documentation
Public variables and functions: calls expect has-args has-matching-signature? make-arg-checker make-count-checker make-mock returns times validate-counts
Variables and functions in mock.test-adapter: calls has-args has-matching-signature? make-arg-checker make-count-checker make-mock report-problem returns times validate-counts
monadic-io-streams
by Konrad HinsenDetailed API documentation
Monadic I/O with Java input/output streams Defines monadic I/O statements to be used in a state monad with an input or output stream as the state. The macro monadic-io creates a stream, runs a monadic I/O statement on it, and closes the stream. This structure permits the definition of purely functional compound I/O statements which are applied to streams that can never escape from the monadic statement sequence.Public variables and functions: flush print println read-char read-line read-lines skip-chars with-io-streams with-reader with-writer write
monads
by Konrad HinsenDetailed API documentation
This library contains the most commonly used monads as well as macros for defining and using monads and useful monadic functions.See also: Monad tutorial part 1 Monad tutorial part 2 Monad tutorial part 3 Monad tutorial part 4 Monads in Clojure part 1 Monads in Clojure part 2
Public variables and functions: call-cc cont-m defmonad defmonadfn domonad fetch-state fetch-val identity-m m-chain m-fmap m-join m-lift m-map m-reduce m-seq m-until m-when m-when-not maybe-m maybe-t monad monad-transformer run-cont sequence-m sequence-t set-m set-state set-val state-m state-m-until state-t update-state update-val with-monad with-state-field writer-m
ns-utils
by Stephen C. GilardiDetailed API documentation
Namespace utilitiesPublic variables and functions: dir docs get-ns immigrate ns-vars print-dir print-docs vars
pprint
by Tom FaulhaberDetailed API documentation
This module comprises two elements: 1) A pretty printer for Clojure data structures, implemented in the function "pprint" 2) A Common Lisp compatible format function, implemented as "cl-format" because Clojure is using the name "format" for its Java-based format function. See documentation for those functions for more information or complete documentation on the the clojure-contrib web site on github.Public variables and functions: *code-dispatch* *print-base* *print-circle* *print-lines* *print-miser-width* *print-pprint-dispatch* *print-pretty* *print-radix* *print-right-margin* *print-shared* *print-suppress-namespaces* *simple-dispatch* cl-format compile-format formatter formatter-out fresh-line pp pprint pprint-indent pprint-logical-block pprint-newline pprint-tab set-pprint-dispatch use-method with-pprint-dispatch write write-out
Variables and functions in pprint.examples.json: dispatch-json json-str print-json
Variables and functions in pprint.examples.xml: *html-compatible* *prxml-indent* prxml
probabilities.finite-distributions
by Konrad HinsenDetailed API documentation
Finite probability distributions This library defines a monad for combining finite probability distributions.Public variables and functions: certainly choose cond-dist-m cond-prob dist-m join-with make-distribution normalize prob uniform zipf
probabilities.monte-carlo
by Konrad HinsenDetailed API documentation
Monte-Carlo method support Monte-Carlo methods transform an input random number stream (usually having a continuous uniform distribution in the interval [0, 1)) into a random number stream whose distribution satisfies certain conditions (usually the expectation value is equal to some desired quantity). They are thus transformations from one probability distribution to another one. This library represents a Monte-Carlo method by a function that takes as input the state of a random number stream with uniform distribution (see clojure.contrib.probabilities.random-numbers) and returns a vector containing one sample value of the desired output distribution and the final state of the input random number stream. Such functions are state monad values and can be composed using operations defined in clojure.contrib.monads.Public variables and functions: discrete exponential lognormal n-sphere normal normal-box-muller random-stream reject sample sample-mean sample-mean-variance sample-reduce sample-sum
probabilities.random-numbers
by Konrad HinsenDetailed API documentation
Random number streams This library provides random number generators with a common stream interface. They all produce pseudo-random numbers that are uniformly distributed in the interval [0, 1), i.e. 0 is a possible value but 1 isn't. For transformations to other distributions, see clojure.contrib.probabilities.monte-carlo. At the moment, the only generator provided is a rather simple linear congruential generator.Public variables and functions: lcg rand-stream
profile
by Stuart SierraDetailed API documentation
Simple code profiling & timing measurement. Wrap any section of code in the prof macro, giving it a name, like this: (defn my-function [x y] (let [sum (prof :addition (+ x y)) product (prof :multiplication (* x y))] [sum product])) The run your code in the profile macro, like this: (profile (dotimes [i 10000] (my-function 3 4))) Which prints a report for each named section of code: Name mean min max count sum addition 265 0 37000 10000 2655000 multiplication 274 0 53000 10000 2747000 Times are measured in nanoseconds, to the maximum precision available under the JVM. See the function documentation for more details.Public variables and functions: *enable-profiling* print-summary prof profile summarize with-profile-data
prxml
by Stuart SierraDetailed API documentation
Compact syntax for generating XML. See the documentation of "prxml" for details.Public variables and functions: *html-compatible* *prxml-indent* prxml
repl-ln
by Stephen C. GilardiDetailed API documentation
A repl with that provides support for lines and line numbers in the input stream.Public variables and functions: print-repl-info repl repl-info repl-prompt set-repl-name set-repl-prompt stream-repl
repl-utils
by Chris Houser, Christophe Grand, Stephen GilardiDetailed API documentation
Utilities meant to be used interactively at the REPLPublic variables and functions: *local-javadocs* *remote-javadocs* add-break-thread! add-local-javadoc add-remote-javadoc break-threads expression-info find-javadoc-url get-source javadoc run run* show source start-handling-break
seq-utils
by Stuart Sierra (and others)Detailed API documentation
Sequence utilities for ClojurePublic variables and functions: fill-queue find-first flatten frequencies group-by includes? indexed partition-all partition-by positions rand-elt rec-cat rec-seq reductions rotations separate seq-on shuffle
server-socket
by Craig McDanielDetailed API documentation
Server socket library - includes REPL on socketPublic variables and functions: create-repl-server create-server
set
by Jason WolfeDetailed API documentation
Clojure functions for operating on sets (supplemental to clojure.set)Public variables and functions: proper-subset? proper-superset? subset? superset?
shell-out
by Chris HouserDetailed API documentation
Conveniently launch a sub-process providing to its stdin and collecting its stdoutPublic variables and functions: sh
singleton
by Stuart SierraDetailed API documentation
Singleton functionsPublic variables and functions: global-singleton per-thread-singleton
sql
by Stephen C. GilardiDetailed API documentation
A Clojure interface to sql databases via jdbc See clojure.contrib.sql.test for an exampleSee also: Example code
Public variables and functions: connection create-table delete-rows do-commands do-prepared drop-table find-connection insert-records insert-rows insert-values is-rollback-only set-rollback-only transaction update-or-insert-values update-values with-connection with-query-results
Variables and functions in sql.internal: connection* find-connection* get-connection print-sql-exception print-sql-exception-chain print-update-counts rollback throw-rollback transaction* with-connection* with-query-results*
Variables and functions in sql.test: create-fruit db-batchupdate-exception db-exception db-get-tables db-grade-a db-grade-range db-read db-read-all db-rollback db-sql-exception db-update db-update-appearance-cost db-update-or-insert db-write drop-fruit insert-records-fruit insert-rows-fruit insert-values-fruit
str-utils
by Stuart SierraDetailed API documentation
String utilities for ClojurePublic variables and functions: chomp chop re-gsub re-partition re-split re-sub str-join
str-utils2
by Stuart SierraDetailed API documentation
This is a library of string manipulation functions. It is intented as a replacement for clojure.contrib.str-utils. You cannot (use 'clojure.contrib.str-utils2) because it defines functions with the same names as functions in clojure.core. Instead, do (require '[clojure.contrib.str-utils2 :as s]) or something similar. Goals: 1. Be functional 2. String argument first, to work with -> 3. Performance linear in string length Some ideas are borrowed from https://github.com/francoisdevlin/devlinsf-clojure-utils/Public variables and functions: blank? butlast capitalize chomp chop codepoints contains? dochars docodepoints drop escape get grep join lower-case ltrim map-str partial partition repeat replace replace-first reverse rtrim split split-lines swap-case tail take trim upper-case
stream-utils
by Konrad HinsenDetailed API documentation
Functions for setting up computational pipelines via data streams. NOTE: This library is experimental. It may change significantly with future release. This library defines: - an abstract stream type, whose interface consists of the multimethod stream-next - a macro for implementing streams - implementations of stream for 1) Clojure sequences, and vectors 2) nil, representing an empty stream - tools for writing stream transformers, including the monad stream-m - various utility functions for working with streams Streams are building blocks in the construction of computational pipelines. A stream is represented by its current state plus a function that takes a stream state and obtains the next item in the stream as well as the new stream state. The state is implemented as a Java class or a Clojure type (as defined by the function clojure.core/type), and the function is provided as an implementation of the multimethod stream-next for this class or type. While setting up pipelines using this mechanism is somewhat more cumbersome than using Clojure's lazy seq mechanisms, there are a few advantages: - The state of a stream can be stored in any Clojure data structure, and the stream can be re-generated from it any number of times. Any number of states can be stored this way. - The elements of the stream are never cached, so keeping a reference to a stream state does not incur an uncontrollable memory penalty. Note that the stream mechanism is thread-safe as long as the concrete stream implementations do not use any mutable state. Stream transformers take any number of input streams and produce one output stream. They are typically written using the stream-m monad. In the definition of a stream transformer, (pick s) returns the next value of stream argument s, whereas pick-all returns the next value of all stream arguments in the form of a vector.Public variables and functions: defst defstream pick pick-all stream-drop stream-filter stream-flatten stream-m stream-map stream-next stream-seq stream-type
swing-utils
by unknown authorDetailed API documentation
Public variables and functions: action-translation-table add-action-listener add-key-typed-listener add-menu-item do-swing do-swing* do-swing-and-wait make-action make-menubar menu-constructor-dispatch
test-is
by Stuart SierraDetailed API documentation
Backwards-compatibility for clojure.contrib.test-is The clojure.contrib.test-is library moved from Contrib into the Clojure distribution as clojure.test. This happened on or around clojure-contrib Git commit 82cf0409d0fcb71be477ebfc4da18ee2128a2ad1 on June 25, 2009. This file makes the clojure.test interface available under the old namespace clojure.contrib.test-is. This includes support for the old syntax of the 'are' macro. This was suggested by Howard Lewis Ship in ticket #26, https://www.assembla.com/spaces/clojure-contrib/tickets/26Public variables and functions: *load-tests* *stack-trace-depth* apply-template are assert-any assert-predicate compose-fixtures deftest deftest- do-template file-position find-holes find-pure-exprs find-symbols flatten-map function? get-possibly-unbound-var inc-report-counter is join-fixtures report run-all-tests run-tests set-test template? test-all-vars test-ns test-var testing testing-contexts-str testing-vars-str try-expr with-test with-test-out
trace
by Stuart SierraDetailed API documentation
This file defines simple "tracing" macros to help you see what your code is doing.Public variables and functions: *trace-depth* deftrace trace trace-fn-call trace-indent tracer
types
by Konrad HinsenDetailed API documentation
General and algebraic data typesPublic variables and functions: defadt deftype deftype- match
with-ns
by Stuart SierraDetailed API documentation
Temporary namespace macroPublic variables and functions: with-ns with-temp-ns
zip-filter
by Chris HouserDetailed API documentation
System for filtering trees and nodes generated by zip.clj in general, and xml trees in particular.Public variables and functions: ancestors children children-auto descendants left-locs leftmost? right-locs rightmost?
Variables and functions in zip-filter.xml: attr attr= seq-test tag= text text= xml-> xml1->
Copyright 2008-2009 Rich Hickey and the various contributors
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.
Clojure auto-documentation system by Tom Faulhaber.