Liking cljdoc? Tell your friends :D

sweet-array.core


aclonecljmacro

(aclone arr)
source

aclone*cljmacro

(aclone* arr)
source

agetcljmacro

(aget arr idx & more)

Works just like clojure.core/aget, but with static checking of the array type to detect type errors at compile time.

Works just like clojure.core/aget, but with static checking of the array type
to detect type errors at compile time.
sourceraw docstring

aget*cljmacro

(aget* arr idx & more)
source

array-class-syntax-supported?clj

source

array-type?clj

(array-type? t)

Returns true if and only if the given type is an array type.

Returns true if and only if the given type is an array type.
sourceraw docstring

array?clj

(array? x)

Returns true if and only if the given object is an array.

Returns true if and only if the given object is an array.
sourceraw docstring

asetcljmacro

(aset arr idx & idxv)

Works just like clojure.core/aset, but with static checking of the array type to detect type errors at compile time.

Works just like clojure.core/aset, but with static checking of the array type
to detect type errors at compile time.
sourceraw docstring

aset*cljmacro

(aset* arr idx & idxv)
source

castcljmacro

(cast type-desc expr)

Casts the given expression expr to the array type denoted by type-desc.

This macro only has the compile-time effect and does nothing at runtime.

Casts the given expression expr to the array type denoted by type-desc.

This macro only has the compile-time effect and does nothing at runtime.
sourceraw docstring

defcljmacro

(def name arr)
(def name docstr arr)

The macro version of def dedicated to arrays. This macro can be used as a drop-in replacement for Clojure's def. Unlike the ordinary def form, (sweet-array.core/def <var> <init>) infers the static type of <init> and implicitly adds the inferred type as the type hint for <var>. Throws an error at macro expansion time if the type of <init> cannot be statically inferred or if the inferred type is not an array type.

The macro version of def dedicated to arrays.
This macro can be used as a drop-in replacement for Clojure's def. Unlike
the ordinary def form, (sweet-array.core/def <var> <init>) infers the static
type of <init> and implicitly adds the inferred type as the type hint for <var>.
Throws an error at macro expansion time if the type of <init> cannot be statically
inferred or if the inferred type is not an array type.
sourceraw docstring

def*cljmacro

(def* name sym docstr expr)
source

install-array-literals!clj

(install-array-literals!)

Experimental - Enables array literals globally.

This function is intended for use in user.clj or other initialization code to enable array literals. Note: This function has no effect when used from the REPL. Use use-array-literals! to enable array literals interactively in the REPL.

Experimental - Enables array literals globally.

This function is intended for use in `user.clj` or other initialization code to
enable array literals. Note: This function has no effect when used from the REPL.
Use `use-array-literals!` to enable array literals interactively in the REPL.
sourceraw docstring

instance?cljmacro

(instance? type-desc x)

Evaluates x and tests if it is an instance of the array type denoted by type-desc.

Evaluates x and tests if it is an instance of the array type denoted by
type-desc.
sourceraw docstring

into-arraycljmacro

(into-array type-desc coll)
(into-array type-desc xform coll)

Converts the given collection (seqable) to an array of the type denoted by type-desc. A transducer may be supplied.

Converts the given collection (seqable) to an array of the type denoted by
type-desc. A transducer may be supplied.
sourceraw docstring

newcljmacro

(new type-desc & args)

Creates an array of the type denoted by type-desc.

The macro has two forms:

  • (new [T] n): produce an array of type T of size n
  • (new [T] [e_1 ... e_n]): produce an array of type T of size n initialized with elements e_1, ..., e_n.
Creates an array of the type denoted by type-desc.

The macro has two forms:
- (new [T] n): produce an array of type T of size n
- (new [T] [e_1 ... e_n]): produce an array of type T of size n initialized
  with elements e_1, ..., e_n.
sourceraw docstring

tagcljmacro

(tag desc)
source

tag-fnclj

(tag-fn type-desc)
source

typecljmacro

(type desc)

Returns the class object that represents the array type denoted by type-desc.

Returns the class object that represents the array type denoted by type-desc.
sourceraw docstring

type-fnclj

(type-fn desc)
source

use-array-literals!clj

(use-array-literals!)

Experimental - Enables array literals for the current REPL session.

Use this function when working in the REPL. Note: This function will throw an error if used in user.clj. If you need to enable array literals for code written in files, use install-array-literals! instead.

Experimental - Enables array literals for the current REPL session.

Use this function when working in the REPL. Note: This function will throw an error
if used in `user.clj`. If you need to enable array literals for code written
in files, use `install-array-literals!` instead.
sourceraw docstring

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

× close