Skip to main content

match

macro

clojure.core.match/match

Available in:BBCLJ
(match [vars & clauses])
Pattern match a row of occurrences. Take a vector of occurrences, vars. Clause question-answer syntax is like `cond`. Questions must be wrapped in a vector, with same arity as vars. Last question can be :else, which expands to a row of wildcards. Optionally may take a single var not wrapped in a vector, questions then need not be wrapped in a vector. Example: (let [x 1 y 2] (match [x y 3] [1 2 3] :answer1 :else :default-answer))

No examples yet. Be the first to add one!