Skip to main content

Accessing

18
  • count

    Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collect...

  • empty

    Returns an empty collection of the same category as coll, or nil

  • find

    Returns the map entry for key, or nil if key not present.

  • first

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

  • get

    Returns the value mapped to key, not-found or nil if key not present in associative collection, set, string, array, or...

  • get-in

    Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil if the key is not p...

  • key

    Returns the key of the map entry.

  • keys

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

  • last

    Return the last item in coll, in linear time

  • next

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

  • nth

    Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is su...

  • peek

    For a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is em...

  • rest

    Returns a possibly empty seq of the items after the first. Calls seq on its argument.

  • second

    Same as (first (next x))

  • seq

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

  • sequence

    Coerces coll to a (possibly empty) sequence, if it is not already one. Will not force a lazy seq. (sequence nil) yield...

  • val

    Returns the value in the map entry.

  • vals

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