Functions I wouldn't mind to see in clojure.core
Functions I wouldn't mind to see in clojure.core
(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
(classic-map? x)
(defn-once sym & rest)
(defn-once-in-core sym & rest)
(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
(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.
(extended-fn? x)
(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.
(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.
(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.
(immigrate-from ns symbols)
Like immigrate
, except wth a list of named symbols.
Like `immigrate`, except wth a list of named symbols.
(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
(invert map)
Produce a map with values as keys. Values are assumed unique.
Produce a map with values as keys. Values are assumed unique.
(listlike? x)
(move-once-to-core source-namespace syms)
(named? x)
(only coll)
Gives the sole element of a sequence
Gives the sole element of a sequence
(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*.
(regex? x)
(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.
(strictly loose-predicate)
(transform map key f)
(transform map key f default)
(transform-in map keyseq f)
(transform-in map keyseq f default)
(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
(var-name v)
Get the namespace-qualified name of a var.
Get the namespace-qualified name of a var.
(var-root var)
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close