Skip to main content

Type System

  • bigdec

    Coerce to BigDecimal

  • bigint

    Coerce to BigInt

  • biginteger

    Coerce to BigInteger

  • boolean

    Coerce to boolean

  • byte

    Coerce to byte

  • denominator

    Returns the denominator part of a Ratio.

  • double

    Coerce to double

  • float

    Coerce to float

  • int

    Coerce to int

  • long

    Coerce to long

  • num

    Coerce to Number

  • numerator

    Returns the numerator part of a Ratio.

  • parse-timestamp

    Parse a string containing an RFC3339-like like timestamp. The function new-instant is called with the following argumen...

  • rationalize

    returns the rational value of num

  • read-instant-calendar

    To read an instant as a java.util.Calendar, bind *data-readers* to a map with this var as the value for the 'inst key. ...

  • read-instant-date

    To read an instant as a java.util.Date, bind *data-readers* to a map with this var as the value for the 'inst key. The t...

  • read-instant-timestamp

    To read an instant as a java.sql.Timestamp, bind *data-readers* to a map with this var as the value for the 'inst key. T...

  • short

    Coerce to short

  • unchecked-byte

    Coerce to byte. Subject to rounding or truncation.

  • unchecked-char

    Coerce to char. Subject to rounding or truncation.

  • unchecked-double

    Coerce to double. Subject to rounding.

  • unchecked-float

    Coerce to float. Subject to rounding.

  • unchecked-int

    Coerce to int. Subject to rounding or truncation.

  • unchecked-long

    Coerce to long. Subject to rounding or truncation.

  • unchecked-short

    Coerce to short. Subject to rounding or truncation.

  • validated

    Return a function which constructs an instant by calling constructor after first validating that those arguments are in ...

  • ancestors

    Returns the immediate and indirect parents of tag, either via a Java type inheritance relationship or a relationship e...

  • definterface

    Creates a new Java interface with the given name and method sigs. The method return types and parameter types may be s...

  • defmethod

    Creates and installs a new method of multimethod associated with dispatch-value.

  • defmulti

    Creates a new multimethod with the associated dispatch function. The docstring and attr-map are optional. Options a...

  • defprotocol

    A protocol is a named set of named methods and their signatures: (defprotocol AProtocolName ;optional doc string ...

  • derive

    Establishes a parent/child relationship between parent and tag. Parent must be a namespace-qualified symbol or keyword...

  • descendants

    Returns the immediate and indirect children of tag, through a relationship established via derive. h must be a hierarc...

  • extend

    Implementations of protocol methods can be provided using the extend construct: (extend AType AProtocol {:fo...

  • extend-protocol

    Useful when you want to provide several implementations of the same protocol all at once. Takes a single protocol and ...

  • extend-type

    A macro that expands into an extend call. Useful when you are supplying the definitions explicitly inline, extend-type...

  • get-method

    Given a multimethod and a dispatch value, returns the dispatch fn that would apply to that value, or nil if none apply...

  • make-hierarchy

    Creates a hierarchy object for use with derive, isa? etc.

  • methods

    Given a multimethod, returns a map of dispatch values -> dispatch fns

  • parents

    Returns the immediate parents of tag, either via a Java type inheritance relationship or a relationship established vi...

  • prefer-method

    Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y when there is a conflict

  • underive

    Removes a parent/child relationship between parent and tag. h must be a hierarchy obtained from make-hierarchy, if not...

  • NaN?

    Returns true if num is NaN, else false

  • any?

    Returns true given any argument.

  • associative?

    Returns true if coll implements Associative

  • bases

    Returns the immediate superclass and direct interfaces of c, if any

  • boolean?

    Return true if x is a Boolean

  • bound?

    Returns true if all of the vars provided as arguments have any bound value, root or thread-local. Implies that deref'...

  • bytes?

    Return true if x is a byte array

  • char?

    Return true if x is a Character

  • class

    Returns the Class of x

  • class?

    Returns true if x is an instance of Class

  • counted?

    Returns true if coll implements count in constant time

  • decimal?

    Returns true if n is a BigDecimal

  • double?

    Return true if x is a Double

  • even?

    Returns true if n is even, throws an exception if n is not an integer

  • extends?

    Returns true if atype extends protocol

  • false?

    Returns true if x is the value false, false otherwise.

  • float?

    Returns true if n is a floating point number

  • fn?

    Returns true if x implements Fn, i.e. is an object created via fn.

  • ident?

    Return true if x is a symbol or keyword

  • identical?

    Tests if 2 arguments are the same object

  • ifn?

    Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn

  • indexed?

    Return true if coll implements Indexed, indicating efficient lookup by index

  • infinite?

    Returns true if num is negative or positive infinity, else false

  • inst?

    Return true if x satisfies Inst

  • instance?

    Evaluates x and tests if it is an instance of the class c. Returns true or false

  • int?

    Return true if x is a fixed precision integer

  • integer?

    Returns true if n is an integer

  • isa?

    Returns true if (= child parent), or child is directly or indirectly derived from parent, either via a Java type inher...

  • keyword?

    Return true if x is a Keyword

  • list?

    Returns true if x implements IPersistentList

  • map-entry?

    Return true if x is a map entry

  • map?

    Return true if x implements IPersistentMap

  • nat-int?

    Return true if x is a non-negative fixed precision integer

  • neg-int?

    Return true if x is a negative fixed precision integer

  • neg?

    Returns true if num is less than zero, else false

  • nil?

    Returns true if x is nil, false otherwise.

  • number?

    Returns true if x is a Number

  • odd?

    Returns true if n is odd, throws an exception if n is not an integer

  • pos-int?

    Return true if x is a positive fixed precision integer

  • pos?

    Returns true if num is greater than zero, else false

  • qualified-ident?

    Return true if x is a symbol or keyword with a namespace

  • qualified-keyword?

    Return true if x is a keyword with a namespace

  • qualified-symbol?

    Return true if x is a symbol with a namespace

  • ratio?

    Returns true if n is a Ratio

  • rational?

    Returns true if n is a rational number

  • realized?

    Returns true if a value has been produced for a promise, delay, future or lazy sequence.

  • record?

    Returns true if x is a record

  • reversible?

    Returns true if coll implements Reversible

  • satisfies?

    Returns true if x satisfies the protocol

  • seq?

    Return true if x implements ISeq

  • seqable?

    Return true if the seq function is supported for x

  • sequential?

    Returns true if coll implements Sequential

  • set?

    Returns true if x implements IPersistentSet

  • simple-ident?

    Return true if x is a symbol or keyword without a namespace

  • simple-keyword?

    Return true if x is a keyword without a namespace

  • simple-symbol?

    Return true if x is a symbol without a namespace

  • some?

    Returns true if x is not nil, false otherwise.

  • sorted?

    Returns true if coll implements Sorted

  • special-symbol?

    Returns true if s names a special form

  • string?

    Return true if x is a String

  • supers

    Returns the immediate and indirect superclasses and interfaces of c, if any

  • symbol?

    Return true if x is a Symbol

  • thread-bound?

    Returns true if all of the vars provided as arguments have thread-local bindings. Implies that set!'ing the provided ...

  • true?

    Returns true if x is the value true, false otherwise.

  • type

    Returns the :type metadata of x, or its Class if none

  • uri?

    Return true if x is a java.net.URI

  • uuid?

    Return true if x is a java.util.UUID

  • var?

    Returns true if v is of type clojure.lang.Var

  • vector?

    Return true if x implements IPersistentVector

  • volatile?

    Returns true if x is a volatile.

  • zero?

    Returns true if num is zero, else false