< Back to Overview
Compiled
Command Line
Arithmetic
Min/Max
Boolean
Equality
Comparison
Number sign?
Integer sign?
Integer kind?
Double kind?
Boolean kind?
Null?
Not null?
Any kind?
String kind?
String
Regex
Cast
Bitwise
REPL results
REPL load
Exceptions
Exception info
Assert
Transient
Volatile
Atom Ref
Watch
Delay Ref
Deref
Pending
Locking
Metadata
Vars
Var meta
Namespace
Namespace meta
Eval
Bindings
If
When
Case
Cond
Conditional threading
Threading
Wrap
Nested/Filtered loop
Recursion
Other loops
Lazy
Lazy forcing
Functions
Macro
Multimethod
Hierarchy
Protocol
Type
Type meta
Record
Ad-hoc Instance
Tagged Literal
Timing
Time instance
Coll content?
Coll capability?
Coll type
Coll capability interfaces
Coll type interfaces
Coll->Seq
JS->Seq
Tree->Seq
Seq->Collection
Args->Collection
Count
Head/Tail
Head/Tail nested
Nth
Take
Drop
Filter
Keep
Map
Combine
Duplicates
Partition
Split
Rearrange
Collection add
Collection update
Collection get
Collection remove
Collection clear
Map entries
Reverse
Sub
Repeat
Derive function
Transduce
Transduce utils
Reduce
Clone
JSON<>EDN
JS kind?
JS array
JS array others
JS object
JS interop
JS arguments
JS syntax
Random
UUID
Name create
Name extract
Name munge
Name kind?
Name qualified?
Name unqualified?
Name reserved?
Name identical?
Machine-readable printing
Human-readable printing
Machine-readable string
Human-readable string
Print core
Print settings
Tap
Hashing
Unchecked
Coercive
MurmurHash3
ES6 Iteration
Chunk
Dummy Cast
Dummy Cast Many
Arrays
Iters
Uncategorized
Types and Protocols

cljs.core

This is the core library of ClojureScript, providing core operations for managing state, creating/manipulating/querying data structures, interop with JS, many predicates, etc.

Some side notes:
  • All of the core library can be referenced without the cljs.core/ qualification.
  • Operations listed as function/macro are flexible and can be used as macros or functions when appropriate. details here
  • You can use this reference to explore the core types and protocols used to implement many of the operations in this core library.
  • We are currently only listing the "ClojureScript JVM" implementations here. The "ClojureScript JS" macro implementations are not listed here, but their API is identical of course.

Compiled

*clojurescript-version* - var

A string indicating the current ClojureScript version.


*target* - dynamic var

A string indicating the current ClojureScript target (e.g. "default" for browsers, "nodejs" for Node)


Command Line

*command-line-args* - var
A sequence of the supplied command line arguments, or nil if
none were supplied

*main-cli-fn* - var

When compiled for a command-line target, whatever function *main-cli-fn* is set to will be called with the command-line argv as arguments.


Arithmetic

* - function/macro
(*)
(* x)
(* x y)
(* x y & more)
Returns the product of nums. (*) returns 1.

+ - function/macro
(+)
(+ x)
(+ x y)
(+ x y & more)
Returns the sum of nums. (+) returns 0.

- - function/macro
(- x)
(- x y)
(- x y & more)
If no ys are supplied, returns the negation of x, else subtracts
the ys from x and returns the result.

/ - function/macro
(/ x)
(/ x y)
(/ x y & more)
If no denominators are supplied, returns 1/numerator,
else returns numerator divided by all of the denominators.

divide - macro
(divide x)
(divide x y)
(divide x y & more)

quot - function
(quot n d)
quot[ient] of dividing numerator by denominator.

rem - function
(rem n d)
remainder of dividing numerator by denominator.

mod - function
(mod n d)
Modulus of num and div. Truncates toward negative infinity.

inc - function/macro
(inc x)
Returns a number one greater than num.

dec - function/macro
(dec x)
Returns a number one less than num.

identity - function
(identity x)
Returns its argument.

Min/Max

min - function/macro
(min x)
(min x y)
(min x y & more)
Returns the least of the nums.

max - function/macro
(max x)
(max x y)
(max x y & more)
Returns the greatest of the nums.

min-key - function
(min-key k x)
(min-key k x y)
(min-key k x y & more)
Returns the x for which (k x), a number, is least.

If there are multiple such xs, the last one is returned.

max-key - function
(max-key k x)
(max-key k x y)
(max-key k x y & more)
Returns the x for which (k x), a number, is greatest.

If there are multiple such xs, the last one is returned.

Boolean

and - macro
(and)
(and x)
(and x & next)
Evaluates exprs one at a time, from left to right. If a form
returns logical false (nil or false), and returns that value and
doesn't evaluate any of the other expressions, otherwise it returns
the value of the last expr. (and) returns true.

or - macro
(or)
(or x)
(or x & next)
Evaluates exprs one at a time, from left to right. If a form
returns a logical true value, or returns that value and doesn't
evaluate any of the other expressions, otherwise it returns the
value of the last expression. (or) returns nil.

not - function
(not x)
Returns true if x is logical false, false otherwise.

Equality

= - function
(= x)
(= x y)
(= x y & more)
Equality. Returns true if x equals y, false if not. Compares
numbers and collections in a type-independent manner.  Clojure's immutable data
structures define -equiv (and thus =) as a value, not an identity,
comparison.

not= - function
(not= x)
(not= x y)
(not= x y & more)
Same as (not (= obj1 obj2))

== - function/macro
(== x)
(== x y)
(== x y & more)
Returns non-nil if nums all have the equivalent
value, otherwise false. Behavior on non nums is
undefined.

identical? - function/macro
(identical? x y)
Tests if 2 arguments are the same object


Comparison

< - function/macro
(< x)
(< x y)
(< x y & more)
Returns non-nil if nums are in monotonically increasing order,
otherwise false.

> - function/macro
(> x)
(> x y)
(> x y & more)
Returns non-nil if nums are in monotonically decreasing order,
otherwise false.

<= - function/macro
(<= x)
(<= x y)
(<= x y & more)
Returns non-nil if nums are in monotonically non-decreasing order,
otherwise false.

>= - function/macro
(>= x)
(>= x y)
(>= x y & more)
Returns non-nil if nums are in monotonically non-increasing order,
otherwise false.

compare - function
(compare x y)
Comparator. Returns a negative number, zero, or a positive number
 when x is logically 'less than', 'equal to', or 'greater than'
 y. Uses IComparable if available and google.array.defaultCompare for objects
of the same type and special-cases nil to be less than any other object.

comparator - function
(comparator pred)
Returns an JavaScript compatible comparator based upon pred.

IComparable - protocol
Protocol for values that can be compared.

Number sign?

pos? - function/macro
(pos? x)
Returns true if num is greater than zero, else false

neg? - function/macro
(neg? x)
Returns true if num is less than zero, else false

zero? - function/macro
(zero? x)
Returns true if num is zero, else false

Integer sign?

pos-int? - function
(pos-int? x)
Return true if x satisfies int? and is positive.

neg-int? - function
(neg-int? x)
Return true if x satisfies int? and is negative.

nat-int? - function
(nat-int? x)
Return true if x satisfies int? and is a natural integer value.

Integer kind?

integer? - function
(integer? n)
Returns true if n is a JavaScript number with no decimal part.

int? - function
(int? x)
Return true if x satisfies integer? or is an instance of goog.math.Integer
or goog.math.Long.

odd? - function
(odd? n)
Returns true if n is odd, throws an exception if n is not an integer

even? - function
(even? n)
Returns true if n is even, throws an exception if n is not an integer

Double kind?

number? - function/macro
(number? x)
Returns true if x is a JavaScript number.

double? - function
(double? x)
Returns true for JavaScript numbers, false otherwise.

float? - function
(float? x)
Returns true for JavaScript numbers, false otherwise.

infinite? - function
(infinite? x)
Returns true for Infinity and -Infinity values.

Boolean kind?

boolean? - function
(boolean? x)
Return true if x is a Boolean

false? - function/macro
(false? x)
Returns true if x is the value false, false otherwise.

true? - function/macro
(true? x)
Returns true if x is the value true, false otherwise.

Null?

nil? - function/macro
(nil? x)
Returns true if x is nil, false otherwise.

undefined? - function/macro
(undefined? x)
Returns true if x identical to the JavaScript undefined value.

Not null?

some? - function/macro
(some? x)
Returns true if x is not nil, false otherwise.

Any kind?

any? - function
(any? x)
Returns true if given any argument.

String kind?

string? - function/macro
(string? x)
Returns true if x is a JavaScript string.

char? - function
(char? x)
Returns true if x is a JavaScript string of length one.

String

str - function/macro
(str)
(str x)
(str x & ys)
With no args, returns the empty string. With one arg x, returns
x.toString().  (str nil) returns the empty string. With more than
one arg, returns the concatenation of the str values of the args.

subs - function
(subs s start)
(subs s start end)
Returns the substring of s beginning at start inclusive, and ending
at end (defaults to length of string), exclusive.

Regex

re-find - function
(re-find re s)
Returns the first regex match, if any, of s to re, using
re.exec(s). Returns a vector, containing first the matching
substring, then any capturing groups if the regular expression contains
capturing groups.

re-matches - function
(re-matches re s)
Returns the result of (re-find re s) if re fully matches s.

re-pattern - function
(re-pattern s)
Returns an instance of RegExp which has compiled the provided string.

re-seq - function
(re-seq re s)
Returns a lazy sequence of successive matches of re in s.

regexp? - function
(regexp? x)
Returns true if x is a JavaScript RegExp instance.

Cast

boolean - function
(boolean x)
Coerce to boolean

char - function
(char x)
Coerce to char

int - function/macro
(int x)
Coerce to int by stripping decimal places.

Bitwise

bit-and - function/macro
(bit-and x y)
(bit-and x y & more)
Bitwise and

bit-and-not - function/macro
(bit-and-not x y)
(bit-and-not x y & more)
Bitwise and with complement

bit-clear - function/macro
(bit-clear x n)
Clear bit at index n

bit-count - function

(bit-count x)

Counts the number of bits set in x.


bit-flip - function/macro
(bit-flip x n)
Flip bit at index n

bit-not - function/macro
(bit-not x)
Bitwise complement

bit-or - function/macro
(bit-or x y)
(bit-or x y & more)
Bitwise or

bit-set - function/macro
(bit-set x n)
Set bit at index n

bit-shift-left - function/macro
(bit-shift-left x n)
Bitwise shift left

bit-shift-right - function/macro
(bit-shift-right x n)
Bitwise shift right

bit-shift-right-zero-fill - function/macro
(bit-shift-right-zero-fill x n)
DEPRECATED: Bitwise shift right with zero fill

bit-test - function/macro
(bit-test x n)
Test bit at index n

bit-xor - function/macro
(bit-xor x y)
(bit-xor x y & more)
Bitwise exclusive or

unsigned-bit-shift-right - function/macro
(unsigned-bit-shift-right x n)
Bitwise shift right with zero fill

int-rotate-left - function
(int-rotate-left x n)

REPL results

*1 - dynamic var

Holds the result of the last REPL expression.


*2 - dynamic var

Holds the result of the second to last REPL expression.


*3 - dynamic var

Holds the result of the third to last REPL expression.


*e - dynamic var

Holds the result of the last exception. REPL only


REPL load

require - macro
(require & args)
Loads libs, skipping any that are already loaded. Each argument is
either a libspec that identifies a lib or a flag that modifies how all the identified
libs are loaded. Use :require in the ns macro in preference to calling this
directly.

Libs

A 'lib' is a named set of resources in classpath whose contents define a
library of ClojureScript code. Lib names are symbols and each lib is associated
with a ClojureScript namespace. A lib's name also locates its root directory
within classpath using Java's package name to classpath-relative path mapping.
All resources in a lib should be contained in the directory structure under its
root directory. All definitions a lib makes should be in its associated namespace.

'require loads a lib by loading its root resource. The root resource path
is derived from the lib name in the following manner:
Consider a lib named by the symbol 'x.y.z; it has the root directory
/x/y/, and its root resource is /x/y/z.clj. The root
resource should contain code to create the lib's namespace (usually by using
the ns macro) and load any additional lib resources.

Libspecs

A libspec is a lib name or a vector containing a lib name followed by
options expressed as sequential keywords and arguments.

Recognized options:
:as takes a symbol as its argument and makes that symbol an alias to the
  lib's namespace in the current namespace.
:refer takes a list of symbols to refer from the namespace.
:refer-macros takes a list of macro symbols to refer from the namespace.
:include-macros true causes macros from the namespace to be required.
:rename specifies a map from referred var names to different
  symbols (and can be used to prevent clashes)


Flags

A flag is a keyword.
Recognized flags: :reload, :reload-all, :verbose
:reload forces loading of all the identified libs even if they are
  already loaded
:reload-all implies :reload and also forces loading of all libs that the
  identified libs directly or indirectly load via require or use
:verbose triggers printing information about each load, alias, and refer

Example:

The following would load the library clojure.string :as string.

(require '[clojure.string :as string])

require-macros - macro
(require-macros & args)
Similar to require but only for macros.

import - macro
(import & import-symbols-or-lists)
import-list => (closure-namespace constructor-name-symbols*)

For each name in constructor-name-symbols, adds a mapping from name to the
constructor named by closure-namespace to the current namespace. Use :import in the ns
macro in preference to calling this directly.

import-macros - macro
(import-macros ns [& vars])

use - macro
(use & args)
Like require, but referring vars specified by the mandatory
:only option.

Example:

The following would load the library clojure.set while referring
the intersection var.

(use '[clojure.set :only [intersection]])

use-macros - macro
(use-macros & args)
Similar to use but only for macros.

refer-clojure - macro
(refer-clojure & args)
Refers to all the public vars of `cljs.core`, subject to
filters.
Filters can include at most one each of:

:exclude list-of-symbols
:rename map-of-fromsymbol-tosymbol

Filters can be used to select a subset, via exclusion, or to provide a mapping
to a symbol different from the var's name, in order to prevent clashes.

load - special form (repl)
(load & paths)
Loads Clojure code from resources in classpath. A path is interpreted as
classpath-relative if it begins with a slash or relative to the root
directory for the current namespace otherwise.

load-file - special form (repl)
(load-file name)
Sequentially read and evaluate the set of forms contained in the file.

load-namespace - special form (repl)

*loaded-libs* - dynamic var

A set of strings indicating the namespaces currently loaded in the REPL.


Exceptions

try - special form
(try expr* catch-clause* finally-clause?)
catch-clause => (catch classname name expr*)
finally-clause => (finally expr*)
Catches and handles JavaScript exceptions.

catch - special form
(catch classname name expr*)
catch-clause => (catch classname name expr*)
finally-clause => (finally expr*)
Catches and handles JavaScript exceptions.

finally - special form
(finally expr*)
catch-clause => (catch classname name expr*)
finally-clause => (finally expr*)
Catches and handles JavaScript exceptions.

throw - special form
(throw expr)
The expr is evaluated and thrown.

Exception info

ex-info - function
(ex-info msg data)
(ex-info msg data cause)
Create an instance of ExceptionInfo, an Error type that carries a
map of additional data.

ex-message - function
(ex-message ex)
Returns the message attached to the given Error / ExceptionInfo object.
For non-Errors returns nil.

ex-data - function
(ex-data ex)
Returns exception data (a map) if ex is an ExceptionInfo.
Otherwise returns nil.

ex-cause - function
(ex-cause ex)
Returns exception cause (an Error / ExceptionInfo) if ex is an
ExceptionInfo.
Otherwise returns nil.

Assert

assert - macro

(assert x) - throw exception if x is false
(assert x message) - include message if assertion fails

Returns nil.


*assert* - dynamic var

Internally used to remove all calls to assert when the compiler option :elide-asserts is set to true. Not to be used manually.


Transient

transient - function
(transient coll)
Returns a new, transient version of the collection, in constant time.

persistent! - function
(persistent! tcoll)
Returns a new, persistent version of the transient collection, in
constant time. The transient collection cannot be used after this
call, any such use will throw an exception.

conj! - function
(conj!)
(conj! tcoll)
(conj! tcoll val)
(conj! tcoll val & vals)
Adds val to the transient collection, and return tcoll. The 'addition'
may happen at different 'places' depending on the concrete type.

pop! - function
(pop! tcoll)
Removes the last item from a transient vector. If
the collection is empty, throws an exception. Returns tcoll

assoc! - function
(assoc! tcoll key val)
(assoc! tcoll key val & kvs)
When applied to a transient map, adds mapping of key(s) to
val(s). When applied to a transient vector, sets the val at index.
Note - index must be <= (count vector). Returns coll.

dissoc! - function
(dissoc! tcoll key)
(dissoc! tcoll key & ks)
Returns a transient map that doesn't contain a mapping for key(s).

disj! - function
(disj! tcoll val)
(disj! tcoll val & vals)
disj[oin]. Returns a transient set of the same (hashed/sorted) type, that
does not contain key(s).

Volatile

volatile! - function
(volatile! val)
Creates and returns a Volatile with an initial value of val.

vswap! - macro
(vswap! vol f & args)
Non-atomically swaps the value of the volatile as if:
(apply f current-value-of-vol args). Returns the value that
was swapped in.

vreset! - function
(vreset! vol newval)
Sets the value of volatile to newval without regard for the
current value. Returns newval.

volatile? - function
(volatile? x)
Returns true if x is a volatile.

Atom Ref

atom - function

(atom x) - creates atom with initial value of x (atom x opts) - adds metadata or validator to atom


swap! - function
(swap! a f)
(swap! a f x)
(swap! a f x y)
(swap! a f x y & more)
Atomically swaps the value of atom to be:
(apply f current-value-of-atom args). Note that f may be called
multiple times, and thus should be free of side effects.  Returns
the value that was swapped in.

reset! - function
(reset! a new-value)
Sets the value of atom to newval without regard for the
current value. Returns new-value.

compare-and-set! - function
(compare-and-set! a oldval newval)
Atomically sets the value of atom to newval if and only if the
current value of the atom is equal to oldval. Returns true if
set happened, else false.

swap-vals! - function
(swap-vals! a f)
(swap-vals! a f x)
(swap-vals! a f x y)
(swap-vals! a f x y & more)
Atomically swaps the value of atom to be:
(apply f current-value-of-atom args). Note that f may be called
multiple times, and thus should be free of side effects.
Returns [old new], the value of the atom before and after the swap.

reset-vals! - function
(reset-vals! a new-value)
Sets the value of atom to newval. Returns [old new], the value of the
atom before and after the reset.

set-validator! - function
(set-validator! iref val)
Sets the validator-fn for an atom. validator-fn must be nil or a
side-effect-free fn of one argument, which will be passed the intended
new state on any state change. If the new state is unacceptable, the
validator-fn should return false or throw an Error. If the current state
is not acceptable to the new validator, an Error will be thrown and the
validator will not be changed.

get-validator - function
(get-validator iref)
Gets the validator-fn for a var/ref/agent/atom.

Watch

add-watch - function
(add-watch iref key f)
Adds a watch function to an atom reference. The watch fn must be a
fn of 4 args: a key, the reference, its old-state, its
new-state. Whenever the reference's state might have been changed,
any registered watches will have their functions called. The watch
fn will be called synchronously. Note that an atom's state
may have changed again prior to the fn call, so use old/new-state
rather than derefing the reference. Keys must be unique per
reference, and can be used to remove the watch with remove-watch,
but are otherwise considered opaque by the watch mechanism.  Bear in
mind that regardless of the result or action of the watch fns the
atom's value will change.  Example:

    (def a (atom 0))
    (add-watch a :inc (fn [k r o n] (assert (== 0 n))))
    (swap! a inc)
    ;; Assertion Error
    (deref a)
    ;=> 1

remove-watch - function
(remove-watch iref key)
Removes a watch (set by add-watch) from a reference

IWatchable - protocol
implemented for Atom
Protocol for types that can be watched. Currently only implemented by Atom.

Delay Ref

delay - macro
(delay & body)
Takes a body of expressions and yields a Delay object that will
invoke the body only the first time it is forced (with force or deref/@), and
will cache the result and return it on all subsequent force
calls.

force - function
(force x)
If x is a Delay, returns the (possibly cached) value of its expression, else returns x

delay? - function
(delay? x)
returns true if x is a Delay created with delay

Deref

deref - function
(deref o)
Also reader macro: @var/@atom/@delay. Returns the
most-recently-committed value of ref. When applied to a var
or atom, returns its current state. When applied to a delay, forces
it if not already forced. See also - realized?.

IDeref - protocol
implemented for Atom Delay Reduced Var Volatile
Protocol for adding dereference functionality to a reference.

Pending

realized? - function
(realized? x)
Returns true if a value has been produced for a delay or lazy sequence.

IPending - protocol
implemented for Cycle Delay Iterate LazySeq Repeat
Protocol for types which can have a deferred realization. Currently only
  implemented by Delay and LazySeq.

Locking

locking - macro
(locking x & forms)

Metadata

meta - function
(meta o)
Returns the metadata of obj, returns nil if there is no metadata.

with-meta - function
(with-meta o meta)
Returns an object of the same type and value as obj, with
map m as its metadata.

vary-meta - function
(vary-meta obj f)
(vary-meta obj f a)
(vary-meta obj f a b)
(vary-meta obj f a b c)
(vary-meta obj f a b c d)
(vary-meta obj f a b c d & args)
Returns an object of the same type and value as obj, with
(apply f (meta obj) args) as its metadata.

reset-meta! - function
(reset-meta! iref m)
Atomically resets the metadata for an atom

alter-meta! - function

(alter-meta! data f & args)

Alter the metadata of data to be (apply f its-current-meta args).


Vars

def- "define" - special form
(def symbol doc-string? init?)
Creates and interns a global var with the name
of symbol in the current namespace (*ns*) or locates such a var if
it already exists.  If init is supplied, it is evaluated, and the
root binding of the var is set to the resulting value.  If init is
not supplied, the root binding of the var is unaffected.

defonce - macro
(defonce x init)
defs name to have the root value of init iff the named var has no root value,
else init is unevaluated

goog-define - macro

Use instead of def when you want to configure its value at compile-time with the :closure-defines compiler option. Must be a string, number, or boolean.


declare - macro
(declare & names)
defs the supplied var names with no bindings, useful for making forward declarations.

Var meta

var - special form
(var symbol)
The symbol must resolve to a var, and the Var object
itself (not its value) is returned. The reader macro #'x expands to (var x).

var? - function
(var? v)
Returns true if v is of type cljs.core.Var

exists? - macro
(exists? x)
Return true if argument exists, analogous to usage of typeof operator
in JavaScript.

resolve - macro
(resolve quoted-sym)
Returns the var to which a symbol will be resolved in the namespace else nil.

set! - special form
(set! var-symbol expr)
(set! (.- instance-expr instanceFieldName-symbol) expr)
Used to set vars and JavaScript object fields

test - function
(test v)
test [v] finds fn at key :test in var metadata and calls it,
presuming failure will throw exception

Namespace

ns - special form
(ns name docstring? attr-map? references*)
You must currently use the ns form only with the following caveats

  * You must use the :only form of :use
  * :require supports :as, :refer, and :rename
    - all options can be skipped
    - in this case a symbol can be used as a libspec directly
      - that is, (:require lib.foo) and (:require [lib.foo]) are both
        supported and mean the same thing
    - :rename specifies a map from referred var names to different
      symbols (and can be used to prevent clashes)
    - prefix lists are not supported
  * The only options for :refer-clojure are :exclude and :rename
  * :import is available for importing Google Closure classes
    - ClojureScript types and records should be brought in with :use
      or :require :refer, not :import ed
  * Macros must be defined in a different compilation stage than the one
    from where they are consumed. One way to achieve this is to define
    them in one namespace and use them from another. They are referenced
    via the :require-macros / :use-macros options to ns
    - :require-macros and :use-macros support the same forms that
      :require and :use do

Implicit macro loading: If a namespace is required or used, and that
namespace itself requires or uses macros from its own namespace, then
the macros will be implicitly required or used using the same
specifications. Furthermore, in this case, macro vars may be included
in a :refer or :only spec. This oftentimes leads to simplified library
usage, such that the consuming namespace need not be concerned about
explicitly distinguishing between whether certain vars are functions
or macros. For example:

(ns testme.core (:require [cljs.test :as test :refer [test-var deftest]]))

will result in test/is resolving properly, along with the test-var
function and the deftest macro being available unqualified.

Inline macro specification: As a convenience, :require can be given
either :include-macros true or :refer-macros [syms...]. Both desugar
into forms which explicitly load the matching Clojure file containing
macros. (This works independently of whether the namespace being
required internally requires or uses its own macros.) For example:

(ns testme.core
(:require [foo.core :as foo :refer [foo-fn] :include-macros true]
          [woz.core :as woz :refer [woz-fn] :refer-macros [app jx]]))

is sugar for

(ns testme.core
(:require [foo.core :as foo :refer [foo-fn]]
          [woz.core :as woz :refer [woz-fn]])
(:require-macros [foo.core :as foo]
                 [woz.core :as woz :refer [app jx]]))

Auto-aliasing clojure namespaces: If a non-existing clojure.* namespace
is required or used and a matching cljs.* namespace exists, the cljs.*
namespace will be loaded and an alias will be automatically established
from the clojure.* namespace to the cljs.* namespace. For example:

(ns testme.core (:require [clojure.test]))

will be automatically converted to

(ns testme.core (:require [cljs.test :as clojure.test]))

ns* - special form

Namespace meta

*ns* - dynamic var

Var bound to a Namespace object representing the current namespace. Only used for bootstrapping.


find-ns - function
(find-ns ns)
Returns the namespace named by the symbol or nil if it doesn't exist.
Bootstrap only.

find-ns-obj - function
(find-ns-obj ns)
Bootstrap only.

find-macros-ns - function
(find-macros-ns ns)
Returns the macros namespace named by the symbol or nil if it doesn't exist.
Bootstrap only.

in-ns - special form (repl)
(in-ns name)
Sets *cljs-ns* to the namespace named by the symbol, creating it if needed.

create-ns - function
(create-ns sym)
(create-ns sym ns-obj)
Create a new namespace named by the symbol. Bootstrap only.

ns-imports - macro
(ns-imports quoted-ns)
Returns a map of the import mappings for the namespace.

ns-interns - macro
(ns-interns quoted-ns)
Returns a map of the intern mappings for the namespace.

ns-interns* - function
(ns-interns* sym)
Returns a map of the intern mappings for the namespace.
Bootstrap only.

ns-name - function
(ns-name ns-obj)
Returns the name of the namespace, a Namespace object.
Bootstrap only.

ns-publics - macro
(ns-publics quoted-ns)
Returns a map of the public intern mappings for the namespace.

ns-unmap - macro
(ns-unmap quoted-ns quoted-sym)
Removes the mappings for the symbol from the namespace.

NS_CACHE - var
Bootstrap only.

Eval

eval - function
(eval form)
Evaluates the form data structure (not text!) and returns the result.
Delegates to cljs.core/*eval*. Intended for use in self-hosted ClojureScript,
which sets up an implementation of cljs.core/*eval* for that environment.

*eval* - dynamic var
Runtime environments may provide a way to evaluate ClojureScript
forms. Whatever function *eval* is bound to will be passed any forms which
should be evaluated.

Bindings

let - macro
(let bindings & body)
binding => binding-form init-expr
binding-form => name, or destructuring-form
destructuring-form => map-destructure-form, or seq-destructure-form

Evaluates the exprs in a lexical context in which the symbols in
the binding-forms are bound to their respective init-exprs or parts
therein.

See https://clojure.org/reference/special_forms#binding-forms for
more information about destructuring.

let* - special form

Internally used by let, which should be used instead.


letfn - macro
(letfn fnspecs & body)
fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+)

Takes a vector of function specs and a body, and generates a set of
bindings of functions to their names. All of the names are available
in all of the definitions of the functions, as well as the body.

letfn* - special form

binding - macro
(binding bindings & body)
binding => var-symbol init-expr

Creates new bindings for the (already-existing) vars, with the
supplied initial values, executes the exprs in an implicit do, then
re-establishes the bindings that existed before.  The new bindings
are made in parallel (unlike let); all init-exprs are evaluated
before the vars are bound to their new values.

with-redefs - macro
(with-redefs bindings & body)
binding => var-symbol temp-value-expr

Temporarily redefines vars while executing the body.  The
temp-value-exprs will be evaluated and each resulting value will
replace in parallel the root value of its var.  After the body is
executed, the root values of all the vars will be set back to their
old values. Useful for mocking out functions during testing.

Note that under advanced compilation vars are statically resolved,
preventing with-redef usage.  If var redefinition is desired in a production
setting then the var to be redefined must be declared ^:dynamic.

If

if - special form
(if test then else?)
Evaluates test. If not the singular values nil or false,
evaluates and yields then, otherwise, evaluates and yields else. If
else is not supplied it defaults to nil.

if-not - macro
(if-not test then)
(if-not test then else)
Evaluates test. If logical false, evaluates and returns then expr, 
otherwise else expr, if supplied, else nil.

if-some - macro
(if-some bindings then)
(if-some bindings then else & oldform)
bindings => binding-form test

If test is not nil, evaluates then with binding-form bound to the
value of test, if not, yields else

if-let - macro
(if-let bindings then)
(if-let bindings then else & oldform)
bindings => binding-form test

If test is true, evaluates then with binding-form bound to the value of 
test, if not, yields else

When

when - macro
(when test & body)
Evaluates test. If logical true, evaluates body in an implicit do.

when-not - macro
(when-not test & body)
Evaluates test. If logical false, evaluates body in an implicit do.

when-some - macro
(when-some bindings & body)
bindings => binding-form test

When test is not nil, evaluates body with binding-form bound to the
value of test

when-first - macro
(when-first bindings & body)
bindings => x xs

Roughly the same as (when (seq xs) (let [x (first xs)] body)) but xs is evaluated only once

when-let - macro
(when-let bindings & body)
bindings => binding-form test

When test is true, evaluates body with binding-form bound to the value of test

Case

case - macro
(case e & clauses)
Takes an expression, and a set of clauses.

Each clause can take the form of either:

test-constant result-expr

(test-constant1 ... test-constantN)  result-expr

The test-constants are not evaluated. They must be compile-time
literals, and need not be quoted.  If the expression is equal to a
test-constant, the corresponding result-expr is returned. A single
default expression can follow the clauses, and its value will be
returned if no clause matches. If no default expression is provided
and no clause matches, an Error is thrown.

Unlike cond and condp, case does a constant-time dispatch, the
clauses are not considered sequentially.  All manner of constant
expressions are acceptable in case, including numbers, strings,
symbols, keywords, and (ClojureScript) composites thereof. Note that since
lists are used to group multiple constants that map to the same
expression, a vector can be used to match a list if needed. The
test-constants need not be all of the same type.

case* - special form

Cond

cond - macro
(cond & clauses)
Takes a set of test/expr pairs. It evaluates each test one at a
time.  If a test returns logical true, cond evaluates and returns
the value of the corresponding expr and doesn't evaluate any of the
other tests or exprs. (cond) returns nil.

condp - macro
(condp pred expr & clauses)
Takes a binary predicate, an expression, and a set of clauses.
Each clause can take the form of either:

test-expr result-expr

test-expr :>> result-fn

Note :>> is an ordinary keyword.

For each clause, (pred test-expr expr) is evaluated. If it returns
logical true, the clause is a match. If a binary clause matches, the
result-expr is returned, if a ternary clause matches, its result-fn,
which must be a unary function, is called with the result of the
predicate as its argument, the result of that call being the return
value of condp. A single default expression can follow the clauses,
and its value will be returned if no clause matches. If no default
expression is provided and no clause matches, an Error is thrown.

Conditional threading

cond-> - macro
(cond-> expr & clauses)
Takes an expression and a set of test/form pairs. Threads expr (via ->)
through each form for which the corresponding test
expression is true. Note that, unlike cond branching, cond-> threading does
not short circuit after the first true test expression.

cond->> - macro
(cond->> expr & clauses)
Takes an expression and a set of test/form pairs. Threads expr (via ->>)
through each form for which the corresponding test expression
is true.  Note that, unlike cond branching, cond->> threading does not short circuit
after the first true test expression.

some-> - macro

When expr is not nil, threads it into the first form (via ->), and when that result is not nil, through the next, etc.


some->> - macro

When expr is not nil, threads it into the first form (via ->>), and when that result is not nil, through the next, etc.


Threading

->- "thread first" - macro
(-> x & forms)
Threads the expr through the forms. Inserts x as the
second item in the first form, making a list of it if it is not a
list already. If there are more forms, inserts the first form as the
second item in second form, etc.

->>- "thread last" - macro
(->> x & forms)
Threads the expr through the forms. Inserts x as the
last item in the first form, making a list of it if it is not a
list already. If there are more forms, inserts the first form as the
last item in second form, etc.

as-> - macro
(as-> expr name & forms)
Binds name to expr, evaluates the first form in the lexical context
of that binding, then binds name to that result, repeating for each
successive form, returning the result of the last form.

Wrap

do - special form
(do exprs*)
Evaluates the expressions in order and returns the value of
the last. If no expressions are supplied, returns nil.

comment - macro
(comment & body)
Ignores body, yields nil

quote - special form
(quote form)
Yields the unevaluated form.

Nested/Filtered loop

for - macro
(for seq-exprs body-expr)
List comprehension. Takes a vector of one or more
 binding-form/collection-expr pairs, each followed by zero or more
 modifiers, and yields a lazy sequence of evaluations of expr.
 Collections are iterated in a nested fashion, rightmost fastest,
 and nested coll-exprs can refer to bindings created in prior
 binding-forms.  Supported modifiers are: :let [binding-form expr ...],
 :while test, :when test.

(take 100 (for [x (range 100000000) y (range 1000000) :while (< y x)]  [x y]))

doseq - macro
(doseq seq-exprs & body)
Repeatedly executes body (presumably for side-effects) with
bindings and filtering as provided by "for".  Does not retain
the head of the sequence. Returns nil.

Recursion

loop - macro
(loop bindings & body)
Evaluates the exprs in a lexical context in which the symbols in
the binding-forms are bound to their respective init-exprs or parts
therein. Acts as a recur target.

loop* - special form

recur - special form
(recur exprs*)
Evaluates the exprs in order, then, in parallel, rebinds
the bindings of the recursion point to the values of the exprs.
Execution then jumps back to the recursion point, a loop or fn method.

trampoline - function
(trampoline f)
(trampoline f & args)
trampoline can be used to convert algorithms requiring mutual
recursion without stack consumption. Calls f with supplied args, if
any. If f returns a fn, calls that fn with no arguments, and
continues to repeat, until the return value is not a fn, then
returns that non-fn value. Note that if you want to return a fn as a
final value, you must wrap it in some data structure and unpack it
after trampoline returns.

Other loops

while - macro
(while test & body)
Repeatedly executes body while test expression is true. Presumes
some side-effect will cause test to become false/nil. Returns nil

dotimes - macro
(dotimes bindings & body)
bindings => name n

Repeatedly executes body (presumably for side-effects) with name
bound to integers from 0 through n-1.

Lazy

lazy-seq - macro
(lazy-seq & body)
Takes a body of expressions that returns an ISeq or nil, and yields
a ISeqable object that will invoke the body only the first time seq
is called, and will cache the result and return it on all subsequent
seq calls.

lazy-cat - macro
(lazy-cat & colls)
Expands to code which yields a lazy sequence of the concatenation
of the supplied colls.  Each coll expr is not evaluated until it is
needed.

(lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))

Lazy forcing

doall - function
(doall coll)
(doall n coll)
When lazy sequences are produced via functions that have side
effects, any effects other than those needed to produce the first
element in the seq do not occur until the seq is consumed. doall can
be used to force any effects. Walks through the successive nexts of
the seq, retains the head and returns it, thus causing the entire
seq to reside in memory at one time.

dorun - function
(dorun coll)
(dorun n coll)
When lazy sequences are produced via functions that have side
effects, any effects other than those needed to produce the first
element in the seq do not occur until the seq is consumed. dorun can
be used to force any effects. Walks through the successive nexts of
the seq, does not retain the head and returns nil.

run! - function
(run! proc coll)
Runs the supplied procedure (via reduce), for purposes of side
effects, on successive items in the collection. Returns nil

Functions

defn - macro
Same as (def name (core/fn [params* ] exprs*)) or (def
 name (core/fn ([params* ] exprs*)+)) with any doc-string or attrs added
 to the var metadata. prepost-map defines a map with optional keys
 :pre and :post that contain collections of pre or post conditions.

defn- - macro
(defn- name & decls)
same as defn, yielding non-public def

fn - macro
(fn & sigs)
params => positional-params* , or positional-params* & next-param
positional-param => binding-form
next-param => binding-form
name => symbol

Defines a function

fn* - special form

fn? - function
(fn? f)
Return true if f is a JavaScript function or satisfies the Fn protocol.

apply - function
(apply f args)
(apply f x args)
(apply f x y args)
(apply f x y z args)
(apply f a b c d & args)
Applies fn f to the argument list formed by prepending intervening arguments to args.

Macro

defmacro - macro
(defmacro name doc-string? attr-map? [params*] body)
(defmacro name doc-string? attr-map? ([params*] body) + attr-map?)
Like defn, but the resulting function name is declared as a
macro and will be used as a macro by the compiler when it is
called.

macroexpand - macro
(macroexpand quoted)
Repeatedly calls macroexpand-1 on form until it no longer
represents a macro form, then returns it.  Note neither
macroexpand-1 nor macroexpand expand macros in subforms.

macroexpand-1 - macro
(macroexpand-1 quoted)
If form represents a macro form, returns its expansion,
else returns form.

gensym - function
(gensym)
(gensym prefix-string)
Returns a new symbol with a unique name. If a prefix string is
supplied, the name is prefix# where # is some unique number. If
prefix is not supplied, the prefix is 'G__'.

Multimethod

defmulti - macro
(defmulti name docstring? attr-map? dispatch-fn & options)
Creates a new multimethod with the associated dispatch function.
The docstring and attribute-map are optional.

Options are key-value pairs and may be one of:
  :default    the default dispatch value, defaults to :default
  :hierarchy  the isa? hierarchy to use for dispatching
              defaults to the global hierarchy

defmethod - macro
(defmethod multifn dispatch-val & fn-tail)
Creates and installs a new method of multimethod associated with dispatch-value. 

get-method - function
(get-method multifn dispatch-val)
Given a multimethod and a dispatch value, returns the dispatch fn
that would apply to that value, or nil if none apply and no default

methods - function
(methods multifn)
Given a multimethod, returns a map of dispatch values -> dispatch fns

prefer-method - function
(prefer-method multifn dispatch-val-x dispatch-val-y)
Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y
when there is a conflict

prefers - function
(prefers multifn)
Given a multimethod, returns a map of preferred value -> set of other values

remove-method - function
(remove-method multifn dispatch-val)
Removes the method of multimethod associated with dispatch-value.

remove-all-methods - function
(remove-all-methods multifn)
Removes all of the methods of multimethod.

default-dispatch-val - function
(default-dispatch-val multifn)
Given a multimethod, return its default-dispatch-val.

dispatch-fn - function
(dispatch-fn multifn)
Given a multimethod, return its dispatch-fn.

Hierarchy

make-hierarchy - function
(make-hierarchy)
Creates a hierarchy object for use with derive, isa? etc.

derive - function
(derive tag parent)
(derive h tag parent)
Establishes a parent/child relationship between parent and
tag. Parent must be a namespace-qualified symbol or keyword and
child can be either a namespace-qualified symbol or keyword or a
class. h must be a hierarchy obtained from make-hierarchy, if not
supplied defaults to, and modifies, the global hierarchy.

underive - function
(underive tag parent)
(underive h tag parent)
Removes a parent/child relationship between parent and
tag. h must be a hierarchy obtained from make-hierarchy, if not
supplied defaults to, and modifies, the global hierarchy.

parents - function
(parents tag)
(parents h tag)
Returns the immediate parents of tag, either via a JavaScript type
inheritance relationship or a relationship established via derive. h
must be a hierarchy obtained from make-hierarchy, if not supplied
defaults to the global hierarchy

ancestors - function
(ancestors tag)
(ancestors h tag)
Returns the immediate and indirect parents of tag, either via a JavaScript type
inheritance relationship or a relationship established via derive. h
must be a hierarchy obtained from make-hierarchy, if not supplied
defaults to the global hierarchy

descendants - function
(descendants tag)
(descendants h tag)
Returns the immediate and indirect children of tag, through a
relationship established via derive. h must be a hierarchy obtained
from make-hierarchy, if not supplied defaults to the global
hierarchy. Note: does not work on JavaScript type inheritance
relationships.

isa? - function
(isa? child parent)
(isa? h child parent)
Returns true if (= child parent), or child is directly or indirectly derived from
parent, either via a JavaScript type inheritance relationship or a
relationship established via derive. h must be a hierarchy obtained
from make-hierarchy, if not supplied defaults to the global
hierarchy

Protocol

defprotocol - macro
(defprotocol psym & doc+methods)
A protocol is a named set of named methods and their signatures:

(defprotocol AProtocolName
  ;optional doc string
  "A doc string for AProtocol abstraction"

;method signatures
  (bar [this a b] "bar docs")
  (baz [this a] [this a b] [this a b c] "baz docs"))

No implementations are provided. Docs can be specified for the
protocol overall and for each method. The above yields a set of
polymorphic functions and a protocol object. All are
namespace-qualified by the ns enclosing the definition The resulting
functions dispatch on the type of their first argument, which is
required and corresponds to the implicit target object ('this' in
JavaScript parlance). defprotocol is dynamic, has no special compile-time
effect, and defines no new types.

(defprotocol P
  (foo [this])
  (bar-me [this] [this y]))

(deftype Foo [a b c]
  P
  (foo [this] a)
  (bar-me [this] b)
  (bar-me [this y] (+ c y)))

(bar-me (Foo. 1 2 3) 42)
=> 45

(foo
  (let [x 42]
    (reify P
      (foo [this] 17)
      (bar-me [this] x)
      (bar-me [this y] x))))
=> 17

extend-protocol - macro
(extend-protocol p & specs)
Useful when you want to provide several implementations of the same
protocol all at once. Takes a single protocol and the implementation
of that protocol for one or more types. Expands into calls to
extend-type:

(extend-protocol Protocol
  AType
    (foo [x] ...)
    (bar [x y] ...)
  BType
    (foo [x] ...)
    (bar [x y] ...)
  AClass
    (foo [x] ...)
    (bar [x y] ...)
  nil
    (foo [x] ...)
    (bar [x y] ...))

expands into:

(do
 (clojure.core/extend-type AType Protocol 
   (foo [x] ...) 
   (bar [x y] ...))
 (clojure.core/extend-type BType Protocol 
   (foo [x] ...) 
   (bar [x y] ...))
 (clojure.core/extend-type AClass Protocol 
   (foo [x] ...) 
   (bar [x y] ...))
 (clojure.core/extend-type nil Protocol 
   (foo [x] ...) 
   (bar [x y] ...)))

Type

deftype - macro
(deftype t fields & impls)
(deftype name [fields*]  options* specs*)

Currently there are no options.

Each spec consists of a protocol or interface name followed by zero
or more method bodies:

protocol-or-Object
(methodName [args*] body)*

The type will have the (by default, immutable) fields named by
fields, which can have type hints. Protocols and methods
are optional. The only methods that can be supplied are those
declared in the protocols/interfaces.  Note that method bodies are
not closures, the local environment includes only the named fields,
and those fields can be accessed directly. Fields can be qualified
with the metadata :mutable true at which point (set! afield aval) will be
supported in method bodies. Note well that mutable fields are extremely
difficult to use correctly, and are present only to facilitate the building
of higherlevel constructs, such as ClojureScript's reference types, in
ClojureScript itself. They are for experts only - if the semantics and
implications of :mutable are not immediately apparent to you, you should not
be using them.

Method definitions take the form:

(methodname [args*] body)

The argument and return types can be hinted on the arg and
methodname symbols. If not supplied, they will be inferred, so type
hints should be reserved for disambiguation.

Methods should be supplied for all methods of the desired
protocol(s). You can also define overrides for methods of Object. Note that
a parameter must be supplied to correspond to the target object
('this' in JavaScript parlance). Note also that recur calls to the method
head should *not* pass the target object, it will be supplied
automatically and can not be substituted.

In the method bodies, the (unqualified) name can be used to name the
class (for calls to new, instance? etc).

One constructor will be defined, taking the designated fields.  Note
that the field names __meta and __extmap are currently reserved and
should not be used when defining your own types.

Given (deftype TypeName ...), a factory function called ->TypeName
will be defined, taking positional parameters for the fields

deftype* - special form

extend-type - macro
(extend-type type-sym & impls)
Extend a type to a series of protocols. Useful when you are
supplying the definitions explicitly inline. Propagates the
type as a type hint on the first argument of all fns.

type-sym may be

 * default, meaning the definitions will apply for any value,
   unless an extend-type exists for one of the more specific
   cases below.
 * nil, meaning the definitions will apply for the nil value.
 * any of object, boolean, number, string, array, or function,
   indicating the definitions will apply for values of the
   associated base JavaScript types. Note that, for example,
   string should be used instead of js/String.
 * a JavaScript type not covered by the previous list, such
   as js/RegExp.
 * a type defined by deftype or defrecord.

(extend-type MyType
  ICounted
  (-count [c] ...)
  Foo
  (bar [x y] ...)
  (baz ([x] ...) ([x y] ...) ...)

Type meta

type - function
(type x)
Return x's constructor.

type->str - function
(type->str ty)

satisfies? - macro
(satisfies? psym x)
Returns true if x satisfies the protocol

instance? - function/macro
(instance? c x)
Evaluates x and tests if it is an instance of the type
c. Returns true or false

implements? - macro
(implements? psym x)
EXPERIMENTAL

is_proto_ - function
(is_proto_ x)

PROTOCOL_SENTINEL - var

Record

defrecord - macro
(defrecord rsym fields & impls)
(defrecord name [fields*]  options* specs*)

Currently there are no options.

Each spec consists of a protocol or interface name followed by zero
or more method bodies:

protocol-or-Object
(methodName [args*] body)*

The record will have the (immutable) fields named by
fields, which can have type hints. Protocols and methods
are optional. The only methods that can be supplied are those
declared in the protocols.  Note that method bodies are
not closures, the local environment includes only the named fields,
and those fields can be accessed directly.

Method definitions take the form:

(methodname [args*] body)

The argument and return types can be hinted on the arg and
methodname symbols. If not supplied, they will be inferred, so type
hints should be reserved for disambiguation.

Methods should be supplied for all methods of the desired
protocol(s). You can also define overrides for
methods of Object. Note that a parameter must be supplied to
correspond to the target object ('this' in JavaScript parlance). Note also
that recur calls to the method head should *not* pass the target object, it
will be supplied automatically and can not be substituted.

In the method bodies, the (unqualified) name can be used to name the
class (for calls to new, instance? etc).

The type will have implementations of several ClojureScript
protocol generated automatically: IMeta/IWithMeta (metadata support) and
IMap, etc.

In addition, defrecord will define type-and-value-based =,
and will define ClojureScript IHash and IEquiv.

Two constructors will be defined, one taking the designated fields
followed by a metadata map (nil for none) and an extension field
map (nil for none), and one taking only the fields (using nil for
meta and extension fields). Note that the field names __meta
and __extmap are currently reserved and should not be used when
defining your own records.

Given (defrecord TypeName ...), two factory functions will be
defined: ->TypeName, taking positional parameters for the fields,
and map->TypeName, taking a map of keywords to field values.

defrecord* - special form

record? - function
(record? x)
Return true if x satisfies IRecord

Ad-hoc Instance

reify - macro
(reify & impls)
reify creates an object implementing a protocol.
 reify is a macro with the following structure:

(reify options* specs*)

 Currently there are no options.

 Each spec consists of the protocol name followed by zero
 or more method bodies:

 protocol
 (methodName [args+] body)*

 Methods should be supplied for all methods of the desired
 protocol(s). You can also define overrides for Object methods. Note that
 the first parameter must be supplied to correspond to the target object
 ('this' in JavaScript parlance). Note also that recur calls
 to the method head should *not* pass the target object, it will be supplied
 automatically and can not be substituted.

 recur works to method heads The method bodies of reify are lexical
 closures, and can refer to the surrounding local scope:

 (str (let [f "foo"]
      (reify Object
        (toString [this] f))))
 == "foo"

 (seq (let [f "foo"]
      (reify ISeqable
        (-seq [this] (seq f)))))
 == ("f" "o" "o"))

 reify always implements IMeta and IWithMeta and transfers meta
 data of the form to the created object.

 (meta ^{:k :v} (reify Object (toString [this] "foo")))
 == {:k :v}

specify - macro
(specify expr & impls)
Identical to specify! but does not mutate its first argument. The first
argument must be an ICloneable instance.

specify! - macro
(specify! expr & impls)
Identical to reify but mutates its first argument.

Tagged Literal

tagged-literal - function
(tagged-literal tag form)
Construct a data representation of a tagged literal from a
tag symbol and a form.

tagged-literal? - function
(tagged-literal? value)
Return true if the value is the data representation of a tagged literal

Timing

system-time - function
(system-time)
Returns highest resolution time offered by host in milliseconds.

time - macro
(time expr)
Evaluates expr and prints the time it took. Returns the value of expr.

simple-benchmark - macro
(simple-benchmark bindings expr iterations & {:keys [print-fn], :or {print-fn (quote println)}})
Runs expr iterations times in the context of a let expression with
the given bindings, then prints out the bindings and the expr
followed by number of iterations and total time. The optional
argument print-fn, defaulting to println, sets function used to
print the result. expr's string representation will be produced
using pr-str in any case.

Time instance

inst-ms - function
(inst-ms inst)
Return the number of milliseconds since January 1, 1970, 00:00:00 GMT

inst? - function
(inst? x)
Return true if x satisfies Inst

Coll content?

contains? - function
(contains? coll v)
Returns true if key is present in the given collection, otherwise
returns false.  Note that for numerically indexed collections like
vectors and arrays, this tests if the numeric key is within the
range of indexes. 'contains?' operates constant or logarithmic time;
it will not perform a linear search for a value.  See also 'some'.

distinct? - function
(distinct? x)
(distinct? x y)
(distinct? x y & more)
Returns true if no two of the arguments are =

empty? - function
(empty? coll)
Returns true if coll has no items. To check the emptiness of a seq,
please use the idiom (seq x) rather than (not (empty? x))

every? - function
(every? pred coll)
Returns true if (pred x) is logical true for every x in coll, else
false.

not-every? - function
(not-every? pred coll)
Returns false if (pred x) is logical true for every x in
coll, else true.

some - function
(some pred coll)
Returns the first logical true value of (pred x) for any x in coll,
else nil.  One common idiom is to use a set as pred, for example
this will return :fred if :fred is in the sequence, otherwise nil:
(some #{:fred} coll)

not-any? - function
(not-any? pred coll)
Returns false if (pred x) is logical true for any x in coll,
else true.

Coll capability?

sequential? - function
(sequential? x)
Returns true if coll satisfies ISequential

associative? - function

Determines if the given collection implements IAssociative (e.g. maps and vectors).


sorted? - function
(sorted? x)
Returns true if coll satisfies ISorted

counted? - function
(counted? x)
Returns true if coll implements count in constant time

reversible? - function
(reversible? coll)
Returns true if coll satisfies? IReversible.

seqable? - function
(seqable? s)
Return true if the seq function is supported for s

indexed? - function
(indexed? x)
Returns true if coll implements nth in constant time

iterable? - function
(iterable? x)
Return true if x implements IIterable protocol.

Coll type

coll? - function
(coll? x)
Returns true if x satisfies ICollection

seq? - function
(seq? s)
Return true if s satisfies ISeq

vector? - function
(vector? x)
Return true if x satisfies IVector

list? - function
(list? x)
Returns true if x implements IList

map? - function
(map? x)
Return true if x satisfies IMap

set? - function
(set? x)
Returns true if x satisfies ISet

Coll capability interfaces


IAssociative - protocol
Protocol for adding associativity to collections.

ISorted - protocol
Protocol for a collection which can represent their items
  in a sorted manner. 


IReversible - protocol
Protocol for reversing a seq.


IIndexed - protocol
Protocol for collections to provide indexed-based access to their items.


Coll type interfaces



IVector - protocol
Protocol for adding vector functionality to collections.

IList - protocol
implemented for Cons EmptyList List
Marker interface indicating a persistent list

IMap - protocol
Protocol for adding mapping functionality to collections.

ISet - protocol
Protocol for adding set functionality to a collection.

Coll->Seq

seq - function
(seq coll)
Returns a seq on the collection. If the collection is
empty, returns nil.  (seq nil) returns nil. seq also works on
Strings.

cons - function
(cons x coll)
Returns a new seq where x is the first element and coll is the rest.

JS->Seq

prim-seq - function

Creates a seq from a JavaScript array or array-like object.


array-seq - function

Creates a seq from a JavaScript array or array-like object, starting at index i if given.


Tree->Seq

tree-seq - function
(tree-seq branch? children root)
Returns a lazy sequence of the nodes in a tree, via a depth-first walk.
branch? must be a fn of one arg that returns true if passed a node
that can have children (but may not).  children must be a fn of one
arg that returns a sequence of the children. Will only be called on
nodes for which branch? returns true. Root is the root node of the
tree.

Seq->Collection

vec - function
(vec coll)
Creates a new vector containing the contents of coll. JavaScript arrays
will be aliased and should not be modified.

set - function
(set coll)
Returns a set of the distinct elements of coll.

Args->Collection

list - function/macro
(list & xs)
Creates a new list containing the items.

list* - function
(list* args)
(list* a args)
(list* a b args)
(list* a b c args)
(list* a b c d & more)
Creates a new list containing the items prepended to the rest, the
last of which will be treated as a sequence.

vector - function/macro
(vector & args)
Creates a new vector containing the args.

hash-map - function/macro
(hash-map & keyvals)
keyval => key val
Returns a new hash map with supplied mappings.

array-map - function/macro
(array-map & keyvals)
keyval => key val
Returns a new array map with supplied mappings.

sorted-map - function
(sorted-map & keyvals)
keyval => key val
Returns a new sorted map with supplied mappings.

sorted-map-by - function
(sorted-map-by comparator & keyvals)
keyval => key val
Returns a new sorted map with supplied mappings, using the supplied comparator.

hash-set - function/macro
(hash-set)
(hash-set & keys)
Returns a new hash set with supplied keys.  Any equal keys are
handled as if by repeated uses of conj.

sorted-set - function
(sorted-set & keys)
Returns a new sorted set with supplied keys.

sorted-set-by - function
(sorted-set-by comparator & keys)
Returns a new sorted set with supplied keys, using the supplied comparator.

obj-map - function
(obj-map & keyvals)
keyval => key val
Returns a new object map with supplied mappings.

Count

count - function
(count coll)
Returns the number of items in the collection. (count nil) returns
0.  Also works on strings, arrays, and Maps

bounded-count - function
(bounded-count n coll)
If coll is counted? returns its count, else will count at most the first n
elements of coll using its seq

Head/Tail

first - function
(first coll)
Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil.

second - function
(second coll)
Same as (first (next x))

(next coll)
Returns a seq of the items after the first. Calls seq on its
argument.  If there are no more items, returns nil

rest - function
(rest coll)
Returns a possibly empty seq of the items after the first. Calls seq on its
argument.

last - function
(last s)
Return the last item in coll, in linear time

butlast - function
(butlast s)
Return a seq of all but the last item in coll, in linear time

Head/Tail nested

ffirst - function
(ffirst coll)
Same as (first (first x))

nnext - function
(nnext coll)
Same as (next (next x))

nfirst - function
(nfirst coll)
Same as (next (first x))

fnext - function
(fnext coll)
Same as (first (next x))

Nth

nth - function
(nth coll n)
(nth coll n not-found)
Returns the value at the index. get returns nil if index out of
bounds, nth throws an exception unless not-found is supplied.  nth
also works for strings, arrays, regex Matchers and Lists, and,
in O(n) time, for sequences.

nthnext - function
(nthnext coll n)
Returns the nth next of coll, (seq coll) when n is 0.

nthrest - function
(nthrest coll n)
Returns the nth rest of coll, coll when n is 0.

Take

take - function
(take n)
(take n coll)
Returns a lazy sequence of the first n items in coll, or all items if
there are fewer than n.  Returns a stateful transducer when
no collection is provided.

take-nth - function
(take-nth n)
(take-nth n coll)
Returns a lazy seq of every nth item in coll.  Returns a stateful
transducer when no collection is provided.

take-last - function
(take-last n coll)
Returns a seq of the last n items in coll.  Depending on the type
of coll may be no better than linear time.  For vectors, see also subvec.

take-while - function
(take-while pred)
(take-while pred coll)
Returns a lazy sequence of successive items from coll while
(pred item) returns logical true. pred must be free of side-effects.
Returns a transducer when no collection is provided.

Drop

drop - function
(drop n)
(drop n coll)
Returns a laziness-preserving sequence of all but the first n items in coll.
Returns a stateful transducer when no collection is provided.

drop-last - function
(drop-last s)
(drop-last n s)
Return a lazy sequence of all but the last n (default 1) items in coll

drop-while - function
(drop-while pred)
(drop-while pred coll)
Returns a lazy sequence of the items in coll starting from the
first item for which (pred item) returns logical false.  Returns a
stateful transducer when no collection is provided.

Filter

filter - function
(filter pred)
(filter pred coll)
Returns a lazy sequence of the items in coll for which
(pred item) returns logical true. pred must be free of side-effects.
Returns a transducer when no collection is provided.

filterv - function
(filterv pred coll)
Returns a vector of the items in coll for which
(pred item) returns logical true. pred must be free of side-effects.

remove - function
(remove pred)
(remove pred coll)
Returns a lazy sequence of the items in coll for which
(pred item) returns logical false. pred must be free of side-effects.
Returns a transducer when no collection is provided.

Keep

keep - function
(keep f)
(keep f coll)
Returns a lazy sequence of the non-nil results of (f item). Note,
this means false return values will be included.  f must be free of
side-effects.  Returns a transducer when no collection is provided.

keep-indexed - function
(keep-indexed f)
(keep-indexed f coll)
Returns a lazy sequence of the non-nil results of (f index item). Note,
this means false return values will be included.  f must be free of
side-effects.  Returns a stateful transducer when no collection is
provided.

Map

map - function
(map f)
(map f coll)
(map f c1 c2)
(map f c1 c2 c3)
(map f c1 c2 c3 & colls)
Returns a lazy sequence consisting of the result of applying f to
the set of first items of each coll, followed by applying f to the
set of second items in each coll, until any one of the colls is
exhausted.  Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments. Returns a transducer when
no collection is provided.

mapv - function
(mapv f coll)
(mapv f c1 c2)
(mapv f c1 c2 c3)
(mapv f c1 c2 c3 & colls)
Returns a vector consisting of the result of applying f to the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted.  Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments.

map-indexed - function
(map-indexed f)
(map-indexed f coll)
Returns a lazy sequence consisting of the result of applying f to 0
and the first item of coll, followed by applying f to 1 and the second
item in coll, etc, until coll is exhausted. Thus function f should
accept 2 arguments, index and item. Returns a stateful transducer when
no collection is provided.

mapcat - function
(mapcat f)
(mapcat f & colls)
Returns the result of applying concat to the result of applying map
to f and colls.  Thus function f should return a collection. Returns
a transducer when no collections are provided

replace - function
(replace smap)
(replace smap coll)
Given a map of replacement pairs and a vector/collection, returns a
vector/seq with any elements = a key in smap replaced with the
corresponding val in smap.  Returns a transducer when no collection
is provided.

Combine

concat - function
(concat)
(concat x)
(concat x y)
(concat x y & zs)
Returns a lazy seq representing the concatenation of the elements in the supplied colls.

flatten - function
(flatten x)
Takes any nested combination of sequential things (lists, vectors,
etc.) and returns their contents as a single, flat sequence.
(flatten nil) returns nil.

merge - function
(merge & maps)
Returns a map that consists of the rest of the maps conj-ed onto
the first.  If a key occurs in more than one map, the mapping from
the latter (left-to-right) will be the mapping in the result.

merge-with - function
(merge-with f & maps)
Returns a map that consists of the rest of the maps conj-ed onto
the first.  If a key occurs in more than one map, the mapping(s)
from the latter (left-to-right) will be combined with the mapping in
the result by calling (f val-in-result val-in-latter).

interleave - function
(interleave)
(interleave c1)
(interleave c1 c2)
(interleave c1 c2 & colls)
Returns a lazy seq of the first item in each coll, then the second etc.

interpose - function
(interpose sep)
(interpose sep coll)
Returns a lazy seq of the elements of coll separated by sep.
Returns a stateful transducer when no collection is provided.

Duplicates

dedupe - function
(dedupe)
(dedupe coll)
Returns a lazy sequence removing consecutive duplicates in coll.
Returns a transducer when no collection is provided.

distinct - function
(distinct)
(distinct coll)
Returns a lazy sequence of the elements of coll with duplicates removed.
Returns a stateful transducer when no collection is provided.

frequencies - function
(frequencies coll)
Returns a map from distinct items in coll to the number of times
they appear.

Partition

partition - function
(partition n coll)
(partition n step coll)
(partition n step pad coll)
Returns a lazy sequence of lists of n items each, at offsets step
apart. If step is not supplied, defaults to n, i.e. the partitions
do not overlap. If a pad collection is supplied, use its elements as
necessary to complete last partition up to n items. In case there are
not enough padding elements, return a partition with less than n items.

partition-all - function
(partition-all n)
(partition-all n coll)
(partition-all n step coll)
Returns a lazy sequence of lists like partition, but may include
partitions with fewer than n items at the end.  Returns a stateful
transducer when no collection is provided.

partition-by - function
(partition-by f)
(partition-by f coll)
Applies f to each value in coll, splitting it each time f returns a
new value.  Returns a lazy seq of partitions.  Returns a stateful
transducer when no collection is provided.

Split

split-at - function
(split-at n coll)
Returns a vector of [(take n coll) (drop n coll)]

split-with - function
(split-with pred coll)
Returns a vector of [(take-while pred coll) (drop-while pred coll)]

group-by - function
(group-by f coll)
Returns a map of the elements of coll keyed by the result of
f on each element. The value at each key will be a vector of the
corresponding elements, in the order they appeared in coll.

Rearrange

sort - function
(sort coll)
(sort comp coll)
Returns a sorted sequence of the items in coll. Comp can be
boolean-valued comparison function, or a -/0/+ valued comparator.
Comp defaults to compare.

sort-by - function
(sort-by keyfn coll)
(sort-by keyfn comp coll)
Returns a sorted sequence of the items in coll, where the sort
order is determined by comparing (keyfn item).  Comp can be
boolean-valued comparison function, or a -/0/+ valued comparator.
Comp defaults to compare.

shuffle - function
(shuffle coll)
Return a random permutation of coll

Collection add

conj- "conjoin" - function
(conj)
(conj coll)
(conj coll x)
(conj coll x & xs)
conj[oin]. Returns a new collection with the xs
'added'. (conj nil item) returns (item).
(conj coll) returns coll. (conj) returns [].
The 'addition' may happen at different 'places' depending
on the concrete type.

into - function
(into)
(into to)
(into to from)
(into to xform from)
Returns a new coll consisting of to-coll with all of the items of
from-coll conjoined. A transducer may be supplied.

assoc- "associate" - function
(assoc coll k v)
(assoc coll k v & kvs)
assoc[iate]. When applied to a map, returns a new map of the
same (hashed/sorted) type, that contains the mapping of key(s) to
val(s). When applied to a vector, returns a new vector that
contains val at index. Note - index must be <= (count vector).

assoc-in - function
(assoc-in m [k & ks] v)
Associates a value in a nested associative structure, where ks is a
sequence of keys and v is the new value and returns a new nested structure.
If any levels do not exist, hash-maps will be created.

Collection update

update - function
(update m k f)
(update m k f x)
(update m k f x y)
(update m k f x y z)
(update m k f x y z & more)
'Updates' a value in an associative structure, where k is a
key and f is a function that will take the old value
and any supplied args and return the new value, and returns a new
structure.  If the key does not exist, nil is passed as the old value.

update-in - function
(update-in m [k & ks] f)
(update-in m [k & ks] f a)
(update-in m [k & ks] f a b)
(update-in m [k & ks] f a b c)
(update-in m [k & ks] f a b c & args)
'Updates' a value in a nested associative structure, where ks is a
sequence of keys and f is a function that will take the old value
and any supplied args and return the new value, and returns a new
nested structure.  If any levels do not exist, hash-maps will be
created.

Collection get

get - function
(get o k)
(get o k not-found)
Returns the value mapped to key, not-found or nil if key not present
in associative collection, set, string, array, or ILookup instance.

get-in - function
(get-in m ks)
(get-in m ks not-found)
Returns the value in a nested associative structure,
where ks is a sequence of keys. Returns nil if the key is not present,
or the not-found value if supplied.

select-keys - function
(select-keys map keyseq)
Returns a map containing only those entries in map whose key is in keys

peek - function
(peek coll)
For a list or queue, same as first, for a vector, same as, but much
more efficient than, last. If the collection is empty, returns nil.

Collection remove

disj - function
(disj coll)
(disj coll k)
(disj coll k & ks)
disj[oin]. Returns a new set of the same (hashed/sorted) type, that
does not contain key(s).

dissoc - function
(dissoc coll)
(dissoc coll k)
(dissoc coll k & ks)
dissoc[iate]. Returns a new map of the same (hashed/sorted) type,
that does not contain a mapping for key(s).

pop - function
(pop coll)
For a list or queue, returns a new list/queue without the first
item, for a vector, returns a new vector without the last item.
Note - not the same as next/butlast.

Collection clear

empty - function
(empty coll)
Returns an empty collection of the same category as coll, or nil

not-empty - function
(not-empty coll)
If coll is empty, returns nil, else coll

Map entries

keys - function
(keys map)
Returns a sequence of the map's keys, in the same order as (seq map).

vals - function
(vals map)
Returns a sequence of the map's values, in the same order as (seq map).

zipmap - function
(zipmap keys vals)
Returns a map with the keys mapped to the corresponding vals.

key - function
(key map-entry)
Returns the key of the map entry.

val - function
(val map-entry)
Returns the value in the map entry.

find - function
(find coll k)
Returns the map entry for key, or nil if key not present.

map-entry? - function
(map-entry? x)
Returns true if x satisfies IMapEntry

Reverse

rseq - function
(rseq rev)
Returns, in constant time, a seq of the items in rev (which
can be a vector or sorted-map), in reverse order. If rev is empty returns nil

reverse - function
(reverse coll)
Returns a seq of the items in coll in reverse order. Not lazy.

Sub

subseq - function
(subseq sc test key)
(subseq sc start-test start-key end-test end-key)
sc must be a sorted collection, test(s) one of <, <=, > or
>=. Returns a seq of those entries with keys ek for
which (test (.. sc comparator (compare ek key)) 0) is true

rsubseq - function
(rsubseq sc test key)
(rsubseq sc start-test start-key end-test end-key)
sc must be a sorted collection, test(s) one of <, <=, > or
>=. Returns a reverse seq of those entries with keys ek for
which (test (.. sc comparator (compare ek key)) 0) is true

subvec - function
(subvec v start)
(subvec v start end)
Returns a persistent vector of the items in vector from
start (inclusive) to end (exclusive).  If end is not supplied,
defaults to (count vector). This operation is O(1) and very fast, as
the resulting vector shares structure with the original and no
trimming is done.

Repeat

cycle - function
(cycle coll)
Returns a lazy (infinite!) sequence of repetitions of the items in coll.

repeat - function
(repeat x)
(repeat n x)
Returns a lazy (infinite!, or length n if supplied) sequence of xs.

replicate - function
(replicate n x)
DEPRECATED: Use 'repeat' instead.
Returns a lazy seq of n xs.

iterate - function
(iterate f x)
Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects

range - function
(range)
(range end)
(range start end)
(range start end step)
Returns a lazy seq of nums from start (inclusive) to end
(exclusive), by step, where start defaults to 0, step to 1,
and end to infinity.

Derive function

partial - function
(partial f)
(partial f arg1)
(partial f arg1 arg2)
(partial f arg1 arg2 arg3)
(partial f arg1 arg2 arg3 & more)
Takes a function f and fewer than the normal arguments to f, and
returns a fn that takes a variable number of additional args. When
called, the returned function calls f with args + additional args.

constantly - function
(constantly x)
Returns a function that takes any number of arguments and returns x.

repeatedly - function
(repeatedly f)
(repeatedly n f)
Takes a function of no args, presumably with side effects, and
returns an infinite (or length n if supplied) lazy sequence of calls
to it

comp - function
(comp)
(comp f)
(comp f g)
(comp f g h)
(comp f1 f2 f3 & fs)
Takes a set of functions and returns a fn that is the composition
of those fns.  The returned fn takes a variable number of args,
applies the rightmost of fns to the args, the next
fn (right-to-left) to the result, etc.

complement - function
(complement f)
Takes a fn f and returns a fn that takes the same arguments as f,
has the same effects, if any, and returns the opposite truth value.

some-fn - function
(some-fn p)
(some-fn p1 p2)
(some-fn p1 p2 p3)
(some-fn p1 p2 p3 & ps)
Takes a set of predicates and returns a function f that returns the first logical true value
returned by one of its composing predicates against any of its arguments, else it returns
logical false. Note that f is short-circuiting in that it will stop execution on the first
argument that triggers a logical true result against the original predicates.

every-pred - function
(every-pred p)
(every-pred p1 p2)
(every-pred p1 p2 p3)
(every-pred p1 p2 p3 & ps)
Takes a set of predicates and returns a function f that returns true if all of its
composing predicates return a logical true value against all of its arguments, else it returns
false. Note that f is short-circuiting in that it will stop execution on the first
argument that triggers a logical false result against the original predicates.

fnil - function
(fnil f x)
(fnil f x y)
(fnil f x y z)
Takes a function f, and returns a function that calls f, replacing
a nil first argument to f with the supplied value x. Higher arity
versions can replace arguments in the second and third
positions (y, z). Note that the function f can take any number of
arguments, not just the one(s) being nil-patched.

juxt - function
(juxt f)
(juxt f g)
(juxt f g h)
(juxt f g h & fs)
Takes a set of functions and returns a fn that is the juxtaposition
of those fns.  The returned fn takes a variable number of args, and
returns a vector containing the result of applying each fn to the
args (left-to-right).
((juxt a b c) x) => [(a x) (b x) (c x)]

memoize - function
(memoize f)
Returns a memoized version of a referentially transparent function. The
memoized version of the function keeps a cache of the mapping from arguments
to results and, when calls with the same arguments are repeated often, has
higher performance at the expense of higher memory use.

Transduce

transduce - function
(transduce xform f coll)
(transduce xform f init coll)
reduce with a transformation of f (xf). If init is not
supplied, (f) will be called to produce it. f should be a reducing
step function that accepts both 1 and 2 arguments, if it accepts
only 2 you can add the arity-1 with 'completing'. Returns the result
of applying (the transformed) xf to init and the first item in coll,
then applying xf to that result and the 2nd item, etc. If coll
contains no items, returns init and f is not called. Note that
certain transforms may inject or skip items.

eduction - function
(eduction xform* coll)
Returns a reducible/iterable application of the transducers
to the items in coll. Transducers are applied in order as if
combined with comp. Note that these applications will be
performed every time reduce/iterator is called.

into - function
(into)
(into to)
(into to from)
(into to xform from)
Returns a new coll consisting of to-coll with all of the items of
from-coll conjoined. A transducer may be supplied.

sequence - function
(sequence coll)
(sequence xform coll)
(sequence xform coll & colls)
Coerces coll to a (possibly empty) sequence, if it is not already
one. Will not force a lazy seq. (sequence nil) yields (), When a
transducer is supplied, returns a lazy sequence of applications of
the transform to the items in coll(s), i.e. to the set of first
items of each coll, followed by the set of second
items in each coll, until any one of the colls is exhausted.  Any
remaining items in other colls are ignored. The transform should accept
number-of-colls arguments

Transduce utils

cat - function
(cat rf)
A transducer which concatenates the contents of each input, which must be a
collection, into the reduction.

halt-when - function
(halt-when pred)
(halt-when pred retf)
Returns a transducer that ends transduction when pred returns true
for an input. When retf is supplied it must be a fn of 2 arguments -
it will be passed the (completed) result so far and the input that
triggered the predicate, and its return value (if it does not throw
an exception) will be the return value of the transducer. If retf
is not supplied, the input that triggered the predicate will be
returned. If the predicate never returns true the transduction is
unaffected.

completing - function
(completing f)
(completing f cf)
Takes a reducing function f of 2 args and returns a fn suitable for
transduce by adding an arity-1 signature that calls cf (default -
identity) on the result argument.

Reduce

reduce - function
(reduce f coll)
(reduce f val coll)
f should be a function of 2 arguments. If val is not supplied,
returns the result of applying f to the first 2 items in coll, then
applying f to that result and the 3rd item, etc. If coll contains no
items, f must accept no arguments as well, and reduce returns the
result of calling f with no arguments.  If coll has only 1 item, it
is returned and f is not called.  If val is supplied, returns the
result of applying f to val and the first item in coll, then
applying f to that result and the 2nd item, etc. If coll contains no
items, returns val and f is not called.

reduce-kv - function
(reduce-kv f init coll)
Reduces an associative collection. f should be a function of 3
arguments. Returns the result of applying f to init, the first key
and the first value in coll, then applying f to that result and the
2nd key and value, etc. If coll contains no entries, returns init
and f is not called. Note that reduce-kv is supported on vectors,
where the keys will be the ordinals.

reduced - function
(reduced x)
Wraps x in a way such that a reduce will terminate with the value x

reduced? - function
(reduced? r)
Returns true if x is the result of a call to reduced

ensure-reduced - function
(ensure-reduced x)
If x is already reduced?, returns it, else returns (reduced x)

unreduced - function
(unreduced x)
If x is reduced?, returns (deref x), else returns x

reduceable? - function
(reduceable? x)
Returns true if coll satisfies IReduce

reductions - function
(reductions f coll)
(reductions f init coll)
Returns a lazy seq of the intermediate values of the reduction (as
per reduce) of coll by f, starting with init.

Clone

clone - function
(clone value)
Clone the supplied value which must implement ICloneable.

cloneable? - function
(cloneable? value)
Return true if x implements ICloneable protocol.


JSON<>EDN

js->clj - function
(js->clj x)
(js->clj x & opts)
Recursively transforms JavaScript arrays into ClojureScript
vectors, and JavaScript objects into ClojureScript maps.  With
option ':keywordize-keys true' will convert object fields from
strings to keywords.

clj->js - function
(clj->js x & {:keys [keyword-fn], :or {keyword-fn name}, :as options})
Recursively transforms ClojureScript values to JavaScript.
sets/vectors/lists become Arrays, Keywords and Symbol become Strings,
Maps become Objects. Arbitrary keys are encoded to by `key->js`.
Options is a key-value pair, where the only valid key is
:keyword-fn, which should point to a single-argument function to be
called on keyword keys. Default to `name`.

key->js - function
(key->js k)
(key->js k primitive-fn)

JS kind?

array? - function
(array? x)
Returns true if x is a JavaScript array.

object? - function
(object? x)
Returns true if x's constructor is Object

js-fn? - macro
(js-fn? x)

js-iterable? - function
(js-iterable? x)
Return true if x has a JavaScript iterator property

js-symbol? - function
(js-symbol? x)
Returns true if x is an instance of Symbol

uri? - function
(uri? x)
Returns true x is a goog.Uri instance.

JS array

array - function/macro

(array 1 2 3 ...)

Creates a JavaScript array containing the given args.


aget - function/macro
(aget array idx)
(aget array idx & idxs)
Returns the value at the index/indices. Works on JavaScript arrays.

aset - function/macro
(aset array idx val)
(aset array idx idx2 & idxv)
Sets the value at the index/indices. Works on JavaScript arrays.
Returns val.

alength - function/macro
(alength array)
Returns the length of the array. Works on arrays of all types.

amap - macro
(amap a idx ret expr)
Maps an expression across an array a, using an index named idx, and
return value named ret, initialized to a clone of a, then setting
each element of ret to the evaluation of expr, returning the new
array ret.

areduce - macro
(areduce a idx ret init expr)
Reduces an expression across an array a, using an index named idx,
and return value named ret, initialized to init, setting ret to the
evaluation of expr at each step, returning ret.

aclone - function
(aclone arr)
Returns a javascript array, cloned from the passed in array

JS array others

make-array - function/macro
(make-array size)
(make-array type size)
(make-array type size & more-sizes)
Construct a JavaScript array of the specified dimensions. Accepts ignored
type argument for compatibility with Clojure. Note that there is no efficient
way to allocate multi-dimensional arrays in JavaScript; as such, this function
will run in polynomial time when called with 3 or more arguments.

object-array - function
(object-array size-or-seq)
(object-array size init-val-or-seq)
Creates an array of objects. Does not coerce array, provided for compatibility
with Clojure.

to-array - function
(to-array coll)
Returns an array containing the contents of coll.

to-array-2d - function
(to-array-2d coll)
Returns a (potentially-ragged) 2-dimensional array
containing the contents of coll.

into-array - function
(into-array aseq)
(into-array type aseq)
Returns an array with components set to the values in aseq. Optional type
argument accepted for compatibility with Clojure.

JS object

js-obj - function/macro
(js-obj)
(js-obj & keyvals)
Create JavaSript object from an even number arguments representing
interleaved keys and values.

js-keys - function
(js-keys obj)
Return the JavaScript keys for an object.

JS interop

. - special form
(. .instanceMethod instance args*)
(. .-instanceField instance)
The instance member form works for methods and fields.
They all expand into calls to the dot operator at macroexpansion time.

.. - macro
(.. x form)
(.. x form & more)
form => fieldName-symbol or (instanceMethodName-symbol args*)

Expands into a member access (.) of the first member on the first
argument, followed by the next member on the result, etc. For
instance:

(.. System (getProperties) (get "os.name"))

expands to:

(. (. System (getProperties)) (get "os.name"))

but is easier to write, read, and understand.

doto - macro
(doto x & forms)
Evaluates x then calls all of the methods and functions with the
value of x supplied at the front of the given arguments.  The forms
are evaluated in order.  Returns x.

(doto (new js/Map) (.set "a" 1) (.set "b" 2))

memfn - macro
(memfn name & args)
Expands into code that creates a fn that expects to be passed an
object and any args and calls the named instance method on the
object passing the args. Use when you want to treat a JavaScript
method as a first-class fn.

new - special form
(new Constructor. args*)
(new Constructor args*)
The args, if any, are evaluated from left to right, and
passed to the JavaScript constructor. The constructed object is
returned.

JS arguments

js-arguments - macro
(js-arguments)

copy-arguments - macro
(copy-arguments dest)

JS syntax

js* - special form

js-comment - macro
(js-comment comment)
Emit a top-level JavaScript multi-line comment. New lines will create a
new comment line. Comment block will be preceded and followed by a newline

js-debugger - macro
(js-debugger)
Emit JavaScript "debugger;" statement

js-delete - function/macro
(js-delete obj key)
Delete a property from a JavaScript object.
Returns true upon success, false otherwise.

js-in - macro
(js-in key obj)

js-inline-comment - macro
(js-inline-comment comment)
Emit an inline JavaScript comment.

js-invoke - function
(js-invoke obj s & args)
Invoke JavaScript object method via string. Needed when the
string is not a valid unquoted property name.

js-mod - function/macro
(js-mod n d)
Modulus of num and div with original javascript behavior. i.e. bug for negative numbers

js-reserved - var

js-str - macro
(js-str s)

this-as - macro
(this-as name & body)
Defines a scope where JavaScript's implicit "this" is bound to the name provided.

Random

rand - function
(rand)
(rand n)
Returns a random floating point number between 0 (inclusive) and
n (default 1) (exclusive).

rand-int - function
(rand-int n)
Returns a random integer between 0 (inclusive) and n (exclusive).

rand-nth - function
(rand-nth coll)
Return a random element of the (sequential) collection. Will have
the same performance characteristics as nth for the given
collection.

random-sample - function
(random-sample prob)
(random-sample prob coll)
Returns items from coll with random probability of prob (0.0 -
1.0).  Returns a transducer when no collection is provided.

UUID

random-uuid - function
(random-uuid)
Returns a pseudo-randomly generated UUID instance (i.e. type 4).

uuid - function
(uuid s)
Returns a UUID consistent with the string s.

uuid? - function
(uuid? x)
Return true if x is a UUID.

Name create

keyword - function
(keyword name)
(keyword ns name)
Returns a Keyword with the given namespace and name.  Do not use :
in the keyword strings, it will be added automatically.

symbol - function
(symbol name)
(symbol ns name)
Returns a Symbol with the given namespace and name. Arity-1 works
on strings, keywords, and vars.

Name extract

name - function
(name x)
Returns the name String of a string, symbol or keyword.

namespace - function
(namespace x)
Returns the namespace String of a symbol or keyword, or nil if not present.

Name munge

munge - function
(munge name)

demunge - function
(demunge name)

CHAR_MAP - var

DEMUNGE_MAP - var

DEMUNGE_PATTERN - var

Name kind?

keyword? - function/macro
(keyword? x)
Return true if x is a Keyword

symbol? - function/macro
(symbol? x)
Return true if x is a Symbol

ident? - function
(ident? x)
Return true if x is a symbol or keyword

Name qualified?

qualified-keyword? - function
(qualified-keyword? x)
Return true if x is a keyword with a namespace

qualified-symbol? - function
(qualified-symbol? x)
Return true if x is a symbol with a namespace

qualified-ident? - function
(qualified-ident? x)
Return true if x is a symbol or keyword with a namespace

Name unqualified?

simple-keyword? - function
(simple-keyword? x)
Return true if x is a keyword without a namespace

simple-symbol? - function
(simple-symbol? x)
Return true if x is a symbol without a namespace

simple-ident? - function
(simple-ident? x)
Return true if x is a symbol or keyword without a namespace

Name reserved?

special-symbol? - function
(special-symbol? x)
Returns true if x names a special form

Name identical?

keyword-identical? - function
(keyword-identical? x y)
Efficient test to determine that two keywords are identical.

symbol-identical? - function
(symbol-identical? x y)
Efficient test to determine that two symbols are identical.

Machine-readable printing

pr - function
(pr & objs)
Prints the object(s) using string-print.  Prints the
object(s), separated by spaces if there is more than one.
By default, pr and prn print in a way that objects can be
read by the reader

prn - function
(prn & objs)
Same as pr followed by (newline).

Human-readable printing

print - function
Prints the object(s) using string-print.
print and println produce output for human consumption.

println - function
(println & objs)
Same as print followed by (newline)

Machine-readable string

pr-str - function
(pr-str & objs)
pr to a string, returning it. Fundamental entrypoint to IPrintWithWriter.

pr-str* - function
(pr-str* obj)
Support so that collections can implement toString without
loading all the printing machinery.

pr-str-with-opts - function
(pr-str-with-opts objs opts)
Prints a sequence of objects to a string, observing all the
options given in opts

prn-str - function
(prn-str & objs)
Same as pr-str followed by (newline)

prn-str-with-opts - function
(prn-str-with-opts objs opts)
Same as pr-str-with-opts followed by (newline)

Human-readable string

(print-str & objs)
print to a string, returning it

println-str - function
(println-str & objs)
println to a string, returning it

Print core

string-print - function
(string-print x)

newline - function
(newline)
(newline opts)
Prints a newline using *print-fn*

with-out-str - macro
(with-out-str & body)
Evaluates exprs in a context in which *print-fn* is bound to .append
on a fresh StringBuffer.  Returns the string created by any nested
printing calls.

flush - function

Flushes the output stream that is the current value of *out*. (Currently unimplemented)


Print settings

*print-dup* - dynamic var

Not implemented. In clojure, it can be bound to true to preserve object types when printing, allowing successful object duplication when read back.


*print-err-fn* - dynamic var

A var representing the function used to print error output, which may differ between runtime environments. Use enable-console-print! to set it to print to console/stderr, then bind as follows:

(enable-console-print!)
(binding [*print-fn* *print-err-fn*]
  (println "printed to stderr in Node, or to browser console as error"))

*print-fn* - dynamic var

A var representing the function used to print output, which may differ between runtime environments. Use enable-console-print! to set it to print to console/stdout.

(enable-console-print!)
(println "printed to stdout in Node, or to browser console")

*print-fn-bodies* - dynamic var
*print-fns-bodies* controls whether functions print their source or
 only their names.

*print-length* - dynamic var

Limits the number of items in each collection to print. Defaults to nil indicating no limit. A ... is printed for items not shown.


*print-level* - dynamic var

Descend only n levels deep when printing a nested object. Defaults to nil indicating no limit. A # is printed for objects at level n.


*print-meta* - dynamic var

Determines if metadata should be included when printing an object. Defaults to false.


*print-namespace-maps* - dynamic var

Determines if maps are printed as namespace maps when all keys have the same namespace. Defaults to false.


*print-newline* - dynamic var

Set to false by enable-console-print! to prevent println and prn from duplicating the newline already appended by JavaScript console.


*print-readably* - dynamic var

Determines if strings are printed with quotes and escape characters. "Readably" means the printed string can be copy-pasted back into the reader to produce the same value.

Do not use directly. The following functions will set this flag appropriately:

true false
pr print
pr-str print-str
prn println
prn-str println-str

*flush-on-newline* - dynamic var

Indicates whether flush is called after a newline is printed.


*out* - dynamic var

Currently unused. Expected to refer to an IWriter object representing standard output for print operations, as it is in Clojure.


set-print-fn! - function
(set-print-fn! f)
Set *print-fn* to f.

set-print-err-fn! - function
(set-print-err-fn! f)
Set *print-err-fn* to f.

enable-console-print! - function
(enable-console-print!)
Set *print-fn* to console.log

Tap

add-tap - function
(add-tap f)
Adds f, a fn of one argument, to the tap set. This function will be called with
anything sent via tap>. Remember f in order to remove-tap

remove-tap - function
(remove-tap f)
Remove f from the tap set.

tap> - function
(tap> x)
Sends x to any taps. Returns the result of *exec-tap-fn*, a Boolean value.

*exec-tap-fn* - dynamic var
(*exec-tap-fn* f)
Arranges to have tap functions executed via the supplied f, a
function of no arguments. Returns true if successful, false otherwise.

Hashing

hash - function
(hash o)
Returns the hash code of its argument. Note this is the hash code
consistent with =.

hash-combine - function
(hash-combine seed hash)

hash-keyword - function
(hash-keyword k)

hash-string - function
(hash-string k)

hash-string* - function
(hash-string* s)

hash-ordered-coll - function
(hash-ordered-coll coll)
Returns the hash code, consistent with =, for an external ordered
collection implementing Iterable.
See http://clojure.org/data_structures#hash for full algorithms.

hash-unordered-coll - function
(hash-unordered-coll coll)
Returns the hash code, consistent with =, for an external unordered
collection implementing Iterable. For maps, the iterator should
return map entries whose hash is computed as
  (hash-ordered-coll [k v]).
See http://clojure.org/data_structures#hash for full algorithms.

mix-collection-hash - function
(mix-collection-hash hash-basis count)
Mix final collection hash for ordered or unordered collections.
hash-basis is the combined collection hash, count is the number
of elements included in the basis. Note this is the hash code
consistent with =, different from .hashCode.
See http://clojure.org/data_structures#hash for full algorithms.

string-hash-cache - var

string-hash-cache-count - var

add-to-string-hash-cache - function
(add-to-string-hash-cache k)

Unchecked

unchecked-add - function/macro
(unchecked-add)
(unchecked-add x)
(unchecked-add x y)
(unchecked-add x y & more)
Returns the sum of nums. (+) returns 0.

unchecked-add-int - function/macro
(unchecked-add-int)
(unchecked-add-int x)
(unchecked-add-int x y)
(unchecked-add-int x y & more)
Returns the sum of nums. (+) returns 0.

unchecked-byte - function/macro
(unchecked-byte x)

unchecked-char - function/macro
(unchecked-char x)

unchecked-dec - function/macro
(unchecked-dec x)
Returns a number one less than x, an int.

unchecked-dec-int - function/macro
(unchecked-dec-int x)
Returns a number one less than x, an int.

unchecked-divide-int - function/macro
(unchecked-divide-int x)
(unchecked-divide-int x y)
(unchecked-divide-int x y & more)
If no denominators are supplied, returns 1/numerator,
else returns numerator divided by all of the denominators.

unchecked-double - function/macro
(unchecked-double x)

unchecked-float - function/macro
(unchecked-float x)

unchecked-get - macro
(unchecked-get obj key)
INTERNAL. Compiles to JavaScript property access using bracket notation. Does
not distinguish between object and array types and not subject to compiler
static analysis.

unchecked-inc - function/macro
(unchecked-inc x)

unchecked-inc-int - function/macro
(unchecked-inc-int x)

unchecked-int - function
(unchecked-int x)
Coerce to int by stripping decimal places.

unchecked-long - function
(unchecked-long x)
Coerce to long by stripping decimal places. Identical to `int'.

unchecked-multiply - function/macro
(unchecked-multiply)
(unchecked-multiply x)
(unchecked-multiply x y)
(unchecked-multiply x y & more)
Returns the product of nums. (*) returns 1.

unchecked-multiply-int - function/macro
(unchecked-multiply-int)
(unchecked-multiply-int x)
(unchecked-multiply-int x y)
(unchecked-multiply-int x y & more)
Returns the product of nums. (*) returns 1.

unchecked-negate - function/macro
(unchecked-negate x)

unchecked-negate-int - function/macro
(unchecked-negate-int x)

unchecked-remainder-int - function/macro
(unchecked-remainder-int x n)

unchecked-set - macro
(unchecked-set obj key val)
INTERNAL. Compiles to JavaScript property access using bracket notation. Does
not distinguish between object and array types and not subject to compiler
static analysis.

unchecked-short - function/macro
(unchecked-short x)

unchecked-subtract - function/macro
(unchecked-subtract x)
(unchecked-subtract x y)
(unchecked-subtract x y & more)
If no ys are supplied, returns the negation of x, else subtracts
the ys from x and returns the result.

unchecked-subtract-int - function/macro
(unchecked-subtract-int x)
(unchecked-subtract-int x y)
(unchecked-subtract-int x y & more)
If no ys are supplied, returns the negation of x, else subtracts
the ys from x and returns the result.

Coercive

coercive-= - macro
(coercive-= x y)

coercive-boolean - macro
(coercive-boolean x)

coercive-not - macro
(coercive-not x)

coercive-not= - macro
(coercive-not= x y)

MurmurHash3

m3-C1 - var

m3-C2 - var

m3-fmix - function
(m3-fmix h1 len)

m3-hash-int - function
(m3-hash-int in)

m3-hash-unencoded-chars - function
(m3-hash-unencoded-chars in)

m3-mix-H1 - function
(m3-mix-H1 h1 k1)

m3-mix-K1 - function
(m3-mix-K1 k1)

m3-seed - var

ES6 Iteration

es6-entries-iterator - function
(es6-entries-iterator coll)

es6-iterable - macro
(es6-iterable ty)

es6-iterator - function
(es6-iterator coll)
Return a ES2015+ compatible iterator for coll.

es6-iterator-seq - function
(es6-iterator-seq iter)
Given an ES2015+ compatible iterator return a seq.

es6-set-entries-iterator - function
(es6-set-entries-iterator coll)

Chunk

chunk - function
(chunk b)

chunk-append - function
(chunk-append b x)

chunk-buffer - function
(chunk-buffer capacity)

chunk-cons - function
(chunk-cons chunk rest)

chunk-first - function
(chunk-first s)

chunk-next - function
(chunk-next s)

chunk-rest - function
(chunk-rest s)

Dummy Cast

byte - function/macro
(byte x)

short - function/macro
(short x)

long - function
(long x)
Coerce to long by stripping decimal places. Identical to `int'.

float - function/macro
(float x)

double - function/macro
(double x)

Dummy Cast Many

booleans - function
(booleans x)

chars - function
(chars x)

bytes - function
(bytes x)

shorts - function
(shorts x)

ints - function
(ints x)

longs - function
(longs x)

floats - function
(floats x)

doubles - function
(doubles x)

Arrays

double-array - function
(double-array size-or-seq)
(double-array size init-val-or-seq)
Creates an array of doubles. Does not coerce array, provided for compatibility
with Clojure.

long-array - function
(long-array size-or-seq)
(long-array size init-val-or-seq)
Creates an array of longs. Does not coerce array, provided for compatibility
with Clojure.

int-array - function
(int-array size-or-seq)
(int-array size init-val-or-seq)
Creates an array of ints. Does not coerce array, provided for compatibility
with Clojure.

Iters

iter - function
(iter coll)

array-iter - function
(array-iter x)

nil-iter - function
(nil-iter)

seq-iter - function
(seq-iter coll)

string-iter - function
(string-iter x)

Uncategorized

*global* - dynamic var
Manually set the JavaScript global context. Only "window", "self"
, and "global" supported. 

*unchecked-arrays* - var

*unchecked-if* - var

Used internally to allow if to use JavaScript truthiness rather than Clojure truthiness, for the performance benefit of saving a function call.


*warn-on-infer* - var

For interop purposes, this is used in conjunction with the compiler option :infer-externs to emit a warning whenever a symbol is in danger of being renamed in advanced :optimizations (i.e. compiler cannot infer an extern). Defaults to false. When set to true, warnings are activated for the rest of the file thereafter.

(set! *warn-on-infer* true)

(defn wrap-baz [x] (.baz x))
;; WARNING: Cannot infer target type in expression (. x baz)

(defn wrap-baz [^js/Foo.Bar x] (.baz x))
;; no more warning after x is annotated

--destructure-map - function
(--destructure-map gmap)

LongImpl - var
INTERNAL: do not use

MODULE_INFOS - var

MODULE_URIS - var

NaN? - function
(NaN? val)
Returns true if num is NaN, else false

Throwable->map - function
(Throwable->map o)
Constructs a data representation for an Error with keys:
 :cause - root cause message
 :phase - error phase
 :via - cause chain, with cause keys:
          :type - exception class symbol
          :message - exception message
          :data - ex-data
          :at - top stack element
 :trace - root cause stack elements

abs - function
(abs a)
Returns the absolute value of a.

array-chunk - function
(array-chunk arr)
(array-chunk arr off)
(array-chunk arr off end)

array-index-of - function
(array-index-of arr k)

array-list - function
(array-list)

bitpos - macro
(bitpos hash shift)

caching-hash - macro
(caching-hash coll hash-fn hash-key)

chunked-seq - function
(chunked-seq vec i off)
(chunked-seq vec node i off)
(chunked-seq vec node i off meta)

chunked-seq? - function
(chunked-seq? x)
Return true if x satisfies IChunkedSeq.

equiv-map - function
(equiv-map x y)
Test map equivalence. Returns true if x equals y, otherwise returns false.

gen-apply-to - macro
(gen-apply-to)

gen-apply-to-simple - macro
(gen-apply-to-simple f num-args args)

gensym_counter - var

hash-double - function
(hash-double f)

hash-long - function
(hash-long high low)

ifind? - function
(ifind? x)
Returns true if coll implements IFind

ifn? - function
(ifn? f)
Returns true if f returns true for fn? or satisfies IFn.

iteration - function
(iteration step & {:keys [somef vf kf initk], :or {vf identity, kf identity, somef some?, initk nil}})
Creates a seqable/reducible via repeated calls to step,
a function of some (continuation token) 'k'. The first call to step
will be passed initk, returning 'ret'. Iff (somef ret) is true,
(vf ret) will be included in the iteration, else iteration will
terminate and vf/kf will not be called. If (kf ret) is non-nil it
will be passed to the next step call, else iteration will terminate.
This can be used e.g. to consume APIs that return paginated or batched data.
 step - (possibly impure) fn of 'k' -> 'ret'
 :somef - fn of 'ret' -> logical true/false, default 'some?'
 :vf - fn of 'ret' -> 'v', a value produced by the iteration, default 'identity'
 :kf - fn of 'ret' -> 'next-k' or nil (signaling 'do not continue'), default 'identity'
 :initk - the first value passed to step, default 'nil'
It is presumed that step with non-initk is unreproducible/non-idempotent.
If step with initk is unreproducible it is on the consumer to not consume twice.

key-test - function
(key-test key other)

load-file* - macro
(load-file* f)

mask - macro
(mask hash shift)

missing-protocol - function
(missing-protocol proto obj)

mk-bound-fn - function
(mk-bound-fn sc test key)

not-native - var

parse-boolean - function
(parse-boolean s)
Parse strings "true" or "false" and return a boolean, or nil if invalid. Note that this explicitly
excludes strings with different cases, or space characters.

parse-double - function
(parse-double s)
Parse string with floating point components and return a floating point value,
or nil if parse fails.
Grammar: https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#valueOf-java.lang.String-

parse-long - function
(parse-long s)
Parse string of decimal digits with optional leading -/+ and return an
integer value, or nil if parse fails

parse-uuid - function
(parse-uuid s)
Parse a string representing a UUID and return a UUID instance,
or nil if parse fails.
Grammar: https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html#toString--

partitionv - function
(partitionv n coll)
(partitionv n step coll)
(partitionv n step pad coll)
Returns a lazy sequence of vectors of n items each, at offsets step
apart. If step is not supplied, defaults to n, i.e. the partitions
do not overlap. If a pad collection is supplied, use its elements as
necessary to complete last partition upto n items. In case there are
not enough padding elements, return a partition with less than n items.

partitionv-all - function
(partitionv-all n)
(partitionv-all n coll)
(partitionv-all n step coll)
Returns a lazy sequence of vector partitions, but may include
partitions with fewer than n items at the end.
Returns a stateful transducer when no collection is provided.

persistent-array-map-seq - function
(persistent-array-map-seq arr i _meta)

pr-seq-writer - function
(pr-seq-writer objs writer opts)

pr-sequential-writer - function
(pr-sequential-writer writer print-one begin sep end opts coll)

(print-map m print-one writer opts)

(print-meta? opts obj)

(print-prefix-map prefix m print-one writer opts)

ranged-iterator - function
(ranged-iterator v start end)

seq-to-map-for-destructuring - function
(seq-to-map-for-destructuring s)
Builds a map from a seq as described in
https://clojure.org/reference/special_forms#keyword-arguments

set-from-indexed-seq - function
(set-from-indexed-seq iseq)

splitv-at - function
(splitv-at n coll)
Returns a vector of [(into [] (take n) coll) (drop n coll)]

spread - function
(spread arglist)

transformer-iterator - function
(transformer-iterator xform sourceIter multi)

truth_ - macro
(truth_ x)

unsafe-bit-and - macro
(unsafe-bit-and x y)
(unsafe-bit-and x y & more)

unsafe-cast - macro
(unsafe-cast t x)
EXPERIMENTAL: Subject to change. Unsafely cast a value to a different type.

update-keys - function
(update-keys m f)
m f => {(f k) v ...}
Given a map m and a function f of 1-argument, returns a new map whose
keys are the result of applying f to the keys of m, mapped to the
corresponding values of m.
f must return a unique key for each key of m, else the behavior is undefined.

update-vals - function
(update-vals m f)
m f => {k (f v) ...}
Given a map m and a function f of 1-argument, returns a new map where the keys of m
are mapped to result of applying f to the corresponding values of m.

write-all - function
(write-all writer & ss)

Types and Protocols

APersistentVector - protocol
implemented for PersistentVector
Marker protocol

ASeq - protocol
Marker protocol indicating an array sequence.

ArrayChunk - type
(ArrayChunk. arr off end)

ArrayIter - type
(ArrayIter. arr i)

ArrayList - type
(ArrayList. arr)

ArrayNode - type
satisfies IIterable
(ArrayNode. edit cnt arr)

ArrayNodeIterator - type
(ArrayNodeIterator. arr i next-iter)


Atom - type
(Atom. state meta validator watches)

BitmapIndexedNode - type
satisfies IIterable
(BitmapIndexedNode. edit bitmap arr)

BitmapIndexedNode.EMPTY - var


Box - type
(Box. val)

ChunkBuffer - type
satisfies ICounted
(ChunkBuffer. buf end)





Delay - type
(Delay. f value)

ES6EntriesIterator - type
(ES6EntriesIterator. s)

ES6Iterator - type
(ES6Iterator. s)

ES6IteratorSeq - type
(ES6IteratorSeq. value iter _rest)

ES6SetEntriesIterator - type
(ES6SetEntriesIterator. s)

Eduction - type
(Eduction. xform coll)

Empty - type
(Empty.)


ExceptionInfo - type
(ExceptionInfo. message data cause)

Fn - protocol
implemented for MetaFn Var function
Marker protocol

HashCollisionNode - type
satisfies IIterable
(HashCollisionNode. edit collision-hash cnt arr)

HashMapIter - type
(HashMapIter. nil-val root-iter seen)

HashSetIter - type
(HashSetIter. iter)

IAtom - protocol
implemented for Atom
Marker protocol indicating an atom.

IChunk - protocol
Protocol for accessing the items of a chunk.

IChunkedNext - protocol
Protocol for accessing the chunks of a collection.

IChunkedSeq - protocol
Protocol for accessing a collection as sequential chunks.

IDerefWithTimeout - protocol

IDrop - protocol
Protocol for persistent or algorithmically defined collections to provide a
  means of dropping N items that is more efficient than sequential walking.

IEditableCollection - protocol
Protocol for collections which can transformed to transients.


IEncodeClojure - protocol

IEncodeJS - protocol

IFind - protocol
Protocol for implementing entry finding in collections.

IFn - protocol
Protocol for adding the ability to invoke an object as a function.
  For example, a vector can also be used to look up a value:
  ([1 2 3 4] 1) => 2


IKVReduce - protocol
Protocol for associative types that can reduce themselves
  via a function of key and val. Called by cljs.core/reduce-kv.


IMapEntry - protocol
implemented for BlackNode MapEntry RedNode
Protocol for examining a map entry.


IMultiFn - protocol
implemented for MultiFn

INamed - protocol
implemented for Keyword MultiFn Symbol
Protocol for adding a name.


IPrintWithWriter - protocol
The old IPrintable protocol's implementation consisted of building a giant
   list of strings to concatenate.  This involved lots of concat calls,
   intermediate vectors, and lazy-seqs, and was very slow in some older JS
   engines.  IPrintWithWriter implements printing via the IWriter protocol, so it
   be implemented efficiently in terms of e.g. a StringBuffer append.

IRecord - protocol
Marker interface indicating a record object


IReset - protocol
Protocol for adding resetting functionality.

IStack - protocol
Protocol for collections to provide access to their items as stacks. The top
  of the stack should be accessed in the most efficient way for the different
  data structures.

ISwap - protocol
Protocol for adding swapping functionality.

ITransientAssociative - protocol
Protocol for adding associativity to transient collections.

ITransientCollection - protocol
Protocol for adding basic functionality to transient collections.

ITransientMap - protocol
Protocol for adding mapping functionality to transient collections.

ITransientSet - protocol
implemented for TransientHashSet
Protocol for adding set functionality to a transient collection.

ITransientVector - protocol
implemented for TransientVector
Protocol for adding vector functionality to transient collections.

IUUID - protocol
implemented for UUID
A marker protocol for UUIDs

IVolatile - protocol
implemented for Volatile
Protocol for adding volatile functionality.


IWriter - protocol
implemented for StringBufferWriter
Protocol for writing. Currently only implemented by StringBufferWriter.


IndexedSeqIterator - type
(IndexedSeqIterator. arr i)

Inst - protocol
implemented for js/Date


IntegerRangeChunk - type
(IntegerRangeChunk. start step count)



Keyword - type
(Keyword. ns name fqn _hash)



List.EMPTY - var

Many - type
(Many. vals)


MetaFn - type
satisfies Fn IFn IMeta IWithMeta
(MetaFn. afn meta)

MultiFn - type
(MultiFn. name dispatch-fn default-dispatch-val hierarchy method-table prefer-table method-cache cached-hierarchy)

MultiIterator - type
(MultiIterator. iters)

Namespace - type
satisfies IEquiv IHash
(Namespace. obj name)

NeverEquiv - type
satisfies IEquiv
(NeverEquiv.)

NodeIterator - type
(NodeIterator. arr i next-entry next-iter)



ObjMap.EMPTY - var

ObjMap.HASHMAP_THRESHOLD - var

ObjMap.fromObject - function
(ObjMap.fromObject ks obj)


PersistentArrayMap.EMPTY - var

PersistentArrayMap.HASHMAP-THRESHOLD - var

PersistentArrayMap.createAsIfByAssoc - function
(PersistentArrayMap.createAsIfByAssoc init)

PersistentArrayMap.createAsIfByAssocComplexPath - function
(PersistentArrayMap.createAsIfByAssocComplexPath init has-trailing?)

PersistentArrayMap.createWithCheck - function
(PersistentArrayMap.createWithCheck arr)

PersistentArrayMap.fromArray - function
(PersistentArrayMap.fromArray arr no-clone no-check)

PersistentArrayMapIterator - type
(PersistentArrayMapIterator. arr i cnt)



PersistentHashMap.EMPTY - var

PersistentHashMap.createWithCheck - function
(PersistentHashMap.createWithCheck arr)

PersistentHashMap.fromArray - function
(PersistentHashMap.fromArray arr no-clone)

PersistentHashMap.fromArrays - function
(PersistentHashMap.fromArrays ks vs)


PersistentHashSet.EMPTY - var

PersistentHashSet.createAsIfByAssoc - function
(PersistentHashSet.createAsIfByAssoc items)

PersistentHashSet.createWithCheck - function
(PersistentHashSet.createWithCheck items)

PersistentHashSet.fromArray - function
(PersistentHashSet.fromArray items no-clone)


PersistentQueue.EMPTY - var

PersistentQueueIter - type
(PersistentQueueIter. fseq riter)

PersistentQueueSeq - type
(PersistentQueueSeq. meta front rear __hash)


PersistentTreeMap.EMPTY - var

PersistentTreeMapSeq - type
(PersistentTreeMapSeq. meta stack ascending? cnt __hash)


PersistentTreeSet.EMPTY - var


PersistentVector.EMPTY - var

PersistentVector.EMPTY-NODE - var

PersistentVector.fromArray - function
(PersistentVector.fromArray xs no-clone)



RangeIterator - type
(RangeIterator. i end step)

RangedIterator - type
(RangedIterator. i base arr v start end)

RecordIter - type
(RecordIter. i record base-count fields ext-map-iter)


Reduced - type
satisfies IDeref
(Reduced. val)


SeqIter - type
(SeqIter. _seq _next)

Single - type
(Single. val)

StringBufferWriter - type
satisfies IWriter
(StringBufferWriter. sb)

StringIter - type
(StringIter. s i)


Symbol - type
(Symbol. ns name str _hash _meta)

TaggedLiteral - type
(TaggedLiteral. tag form)

TransformerIterator - type
(TransformerIterator. buffer _next completed xf sourceIter multi)

TransformerIterator.create - function
(TransformerIterator.create xform source)

TransformerIterator.createMulti - function
(TransformerIterator.createMulti xform sources)

TransientArrayMap - type
(TransientArrayMap. editable? len arr)

TransientHashMap - type
(TransientHashMap. edit root count has-nil? nil-val)

TransientHashSet - type
(TransientHashSet. transient-map)

TransientVector - type
(TransientVector. cnt shift root tail)

UUID - type
(UUID. uuid __hash)


Var - type
(Var. val sym _meta)

VectorNode - type
(VectorNode. edit arr)

Volatile - type
(Volatile. state)