Skip to main content

Host Interop

  • defrecord

    (defrecord name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interf...

  • deftype

    (deftype name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interfac...

  • extend-protocol

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

  • extend-type

    Extend a type to a series of protocols. Useful when you are supplying the definitions explicitly inline. Propagates the ...

  • reify

    reify creates an object implementing a protocol. reify is a macro with the following structure: (reify options* specs*...

  • aclone

    Returns a javascript array, cloned from the passed in array

  • aget

    Returns the value at the index/indices. Works on JavaScript arrays.

  • alength

    Returns the length of the array. Works on arrays of all types.

  • amap

    Maps an expression across an array a, using an index named idx, and return value named ret, initialized to a clone of a,...

  • areduce

    Reduces an expression across an array a, using an index named idx, and return value named ret, initialized to init, sett...

  • aset

    Sets the value at the index/indices. Works on JavaScript arrays. Returns val.

  • double-array

    Creates an array of doubles. Does not coerce array, provided for compatibility with Clojure.

  • int-array

    Creates an array of ints. Does not coerce array, provided for compatibility with Clojure.

  • into-array

    Returns an array with components set to the values in aseq. Optional type argument accepted for compatibility with Cloju...

  • long-array

    Creates an array of longs. Does not coerce array, provided for compatibility with Clojure.

  • make-array

    Construct a JavaScript array of the specified dimensions. Accepts ignored type argument for compatibility with Clojure. ...

  • object-array

    Creates an array of objects. Does not coerce array, provided for compatibility with Clojure.

  • set!

    Used to set vars and JavaScript object fields

  • to-array

    Returns an array containing the contents of coll.

  • to-array-2d

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

  • array

    Creates a new javascript array. @param {...*} var_args

  • clj->js

    Recursively transforms ClojureScript values to JavaScript. sets/vectors/lists become Arrays, Keywords and Symbol become ...

  • js->clj

    Recursively transforms JavaScript arrays into ClojureScript vectors, and JavaScript objects into ClojureScript maps. Wi...

  • js-comment

    Emit a top-level JavaScript multi-line comment. New lines will create a new comment line. Comment block will be preceded...

  • js-debugger

    Emit JavaScript "debugger;" statement

  • js-delete

    Delete a property from a JavaScript object. Returns true upon success, false otherwise.

  • js-inline-comment

    Emit an inline JavaScript comment.

  • js-invoke

    Invoke JavaScript object method via string. Needed when the string is not a valid unquoted property name.

  • js-keys

    Return the JavaScript keys for an object.

  • js-obj

    Create JavaSript object from an even number arguments representing interleaved keys and values.

  • specify

    Identical to specify! but does not mutate its first argument. The first argument must be an ICloneable instance.

  • specify!

    Identical to reify but mutates its first argument.

  • this-as

    Defines a scope where JavaScript's implicit "this" is bound to the name provided.

  • .

    The instance member form works for methods and fields. They all expand into calls to the dot operator at macroexpansion ...

  • memfn

    Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method...