Liking cljdoc? Tell your friends :D

marick.clojure.core

Functions I wouldn't mind to see in clojure.core

Functions I wouldn't mind to see in clojure.core
raw docstring

any?clj


cl-formatclj

(cl-format writer format-in & args)

An implementation of a Common Lisp compatible format function. cl-format formats its arguments to an output stream or string based on the format control string given. It supports sophisticated formatting of structured data.

Writer is an instance of java.io.Writer, true to output to out or nil to output to a string, format-in is the format control string and the remaining arguments are the data to be formatted.

The format control string is a string to be output with embedded 'format directives' describing how to format the various arguments passed in.

If writer is nil, cl-format returns the formatted result string. Otherwise, cl-format returns nil.

For example: (let [results [46 38 22]] (cl-format true "There ~[are~;is~:;are~]~:* ~d result~:p: ~{~d~^, ~}~%" (count results) results))

Prints to out: There are 3 results: 46, 38, 22

Detailed documentation on format control strings is available in the "Common Lisp the Language, 2nd edition", Chapter 22 (available online at: http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/clm/node200.html#SECTION002633000000000000000) and in the Common Lisp HyperSpec at http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm

An implementation of a Common Lisp compatible format function. cl-format formats its
arguments to an output stream or string based on the format control string given. It 
supports sophisticated formatting of structured data.

Writer is an instance of java.io.Writer, true to output to *out* or nil to output 
to a string, format-in is the format control string and the remaining arguments 
are the data to be formatted.

The format control string is a string to be output with embedded 'format directives' 
describing how to format the various arguments passed in.

If writer is nil, cl-format returns the formatted result string. Otherwise, cl-format 
returns nil.

For example:
 (let [results [46 38 22]]
        (cl-format true "There ~[are~;is~:;are~]~:* ~d result~:p: ~{~d~^, ~}~%" 
                   (count results) results))

Prints to *out*:
 There are 3 results: 46, 38, 22

Detailed documentation on format control strings is available in the "Common Lisp the 
Language, 2nd edition", Chapter 22 (available online at:
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/clm/node200.html#SECTION002633000000000000000) 
and in the Common Lisp HyperSpec at 
http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm
raw docstring

classic-map?clj

(classic-map? x)

defn-oncecljmacro

(defn-once sym & rest)

defn-once-in-corecljmacro

(defn-once-in-core sym & rest)

differenceclj

(difference s1)
(difference s1 s2)
(difference s1 s2 & sets)

Return a set that is the first set without elements of the remaining sets

Return a set that is the first set without elements of the remaining sets
raw docstring

dissoc-keypathclj

(dissoc-keypath map keys)

Like dissoc, but takes a sequence of keys. There must be at least two keys.

Like `dissoc`, but takes a sequence of keys.
There must be at least two keys.
raw docstring

extended-fn?clj

(extended-fn? x)

find-firstclj

(find-first pred coll)

Returns the first item of coll where (pred item) returns logical true.

Returns the first item of coll where (pred item) returns logical true.
raw docstring

hash-map-duplicates-okclj

(hash-map-duplicates-ok & keys-and-vals)

Like hash-map, except duplicate keys are OK. Last one takes precedence. This is required for Clojure 1.4.

Like hash-map, except duplicate keys are OK. Last one takes precedence.
This is required for Clojure 1.4.
raw docstring

immigrateclj

(immigrate & ns-names)

Create a public var in this namespace for each public var in the namespaces named by ns-names. The created vars have the same name, root binding, and metadata as the original except that their :ns metadata value is this namespace.

Create a public var in this namespace for each public var in the
namespaces named by ns-names. The created vars have the same name, root
binding, and metadata as the original except that their :ns metadata
value is this namespace.
raw docstring

immigrate-fromclj

(immigrate-from ns symbols)

Like immigrate, except wth a list of named symbols.

Like `immigrate`, except wth a list of named symbols.
raw docstring

intersectionclj

(intersection s1)
(intersection s1 s2)
(intersection s1 s2 & sets)

Return a set that is the intersection of the input sets

Return a set that is the intersection of the input sets
raw docstring

invertclj

(invert map)

Produce a map with values as keys. Values are assumed unique.

Produce a map with values as keys.
Values are assumed unique.
raw docstring

listlike?clj

(listlike? x)

move-once-to-corecljmacro

(move-once-to-core source-namespace syms)

named?clj

(named? x)

not-empty?clj


onlyclj

(only coll)

Gives the sole element of a sequence

Gives the sole element of a sequence
raw docstring

pprintclj

(pprint object)
(pprint object writer)

Pretty print object to the optional output writer. If the writer is not provided, print the object to the currently bound value of out.

Pretty print object to the optional output writer. If the writer is not provided, 
print the object to the currently bound value of *out*.
raw docstring

regex?clj

(regex? x)

separateclj

(separate pred coll)

Split coll into two sequences, one that matches pred and one that doesn't. Unlike the version in clojure.contrib.seq-utils, pred is only called once per item.

Split coll into two sequences, one that matches pred and one that doesn't. Unlike the
version in clojure.contrib.seq-utils, pred is only called once per item.
raw docstring

strictlyclj

(strictly loose-predicate)

stringlike?clj

(stringlike? x)

String or regex

String or regex
raw docstring

subset?clj

(subset? set1 set2)

Is set1 a subset of set2?

Is set1 a subset of set2?
raw docstring

transformclj

(transform map key f)
(transform map key f default)

transform-inclj

(transform-in map keyseq f)
(transform-in map keyseq f default)

unionclj

(union)
(union s1)
(union s1 s2)
(union s1 s2 & sets)

Return a set that is the union of the input sets

Return a set that is the union of the input sets
raw docstring

var-nameclj

(var-name v)

Get the namespace-qualified name of a var.

Get the namespace-qualified name of a var.
raw docstring

var-rootclj

(var-root var)

vertical-slicesclj

(vertical-slices & sequences)

Given N sequences, return one sequence whose first element is a sequence of all the first elements, etc.

Given N sequences, return one sequence whose first element
is a sequence of all the first elements, etc.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close