Skip to content

Collections

assoc

1
2
3
4
(def _args
    (eval
    (quasiquote
    (assoc {} ~@*command-line-args*))))

concat

1

conj

1

cons

Constructs a list recursively using the pattern (cons element rest-of-list).

1
(cons 1 (cons 2 (cons 3 nil)))
(1 2 3)

contains?

Checks whether a hashmap contains a record with the given key.

1
2
3
(if (contains? _args "--file")
    (get _args "--file")
    "")

count

Counts the number of elements in a list, sequence or vector.

1
2
3
(if (> (count parameters) 0)
    "at least one parameter"
    "no parameters")

dissoc

1

empty?

Checks whether a list, sequence or vector has no elements.

1
2
3
(if (empty? parameters)
    "no parameters"
    "at least one parameter")

get

Gets the value represented by the given key, or nil if not found.

1
2
3
(if (contains? _args "--file")
    (get _args "--file")
    "")

first

1

keys

Gets a list of all the keys from a hashmap.

1

list

1

hash-map

1

map

1

nth

1

rest

1

reverse

Creates a new sequence with the elements in reverse order.

1

seq

1

vals

Gets a list of all the values from a hashmap.

1

vector

1