Common Clojure Expression Flashcards
Common Clojure Expression Flashcards
= is
if fn
def str
deftest map
Bind names in a local scope. Define a function at the top level.
Assert that an expression returns truthy inside of a Return true if all arguments are equal, false
test. otherwise.
defn- first
when testing
or apply
assoc count
Thread-first macro. Define a namespace at the top of a file.
Return the number of elements in the given Add one or more key/value pairs to an associative
collection. data structure such as a hashmap or vector.
and not
nil? defmethod
+ defmacro
get *
cond recur
Evaluate expressions in turn, returning the first that
Return true if the argument is falsey, false otherwise.
is not truthy, or the last one otherwise.
Define a method in a multimethod. Return true if the argument is nil, false otherwise.
seq doseq
->> throw
atom reduce
- name
Execute all expressions and return the value of the
Print out all arguments and output a new line.
last expression.
if-let inc
swap! into
range filter
get-in merge
Add an element to a collection. Check if a value is an instance of a class or interface.
for try
list format
catch when-not
rest <
Returns true if there are no elements in a collection,
Create a scope for tail recursion.
false otherwise.
concat reset!
set when-let
/ int
cons nth
Take a function and arguments and make a new
Convert a collection to a vector.
function that has those arguments already applied.
Retrieve an element from a seq by numeric index. Add an element to the beginning of a seq.
assert defproject
second are
contains? update-in
> doto
defprotocol .
Define a Leiningen project. Throw an AssertionError if expression is false.
Assert that multiple expressions are truthy in a test. Return the second element of a seq.
Execute forms on first argument, then return it. Mathematical greater than.
keys next
map? string?
set! aget
keyword if-not
Numeric equality comparison (type-independent). Return the metadata on a value.
Return true if the argument is a string, false Return true if the argument is a map, false otherwise.
otherwise.
dec dissoc
defrecord comp
not= thrown?
float select
Create a symbol from a string or a namespace and
Create thread-local bindings for dynamic vars.
name.
A special form in clojure.test/is expressions to check Return true if the arguments are not equal, false
if an exception is thrown. otherwise.