A precondition checks an input before a Clojure function body runs. Put Boolean assertions in a `:pre` vector immediately after the argument vector in `defn`. If an assertion fails, the call raises an `AssertionError` instead of evaluating the body. section 2.1.1
Check an item before saving it
`(defn save! [item] {:pre [(map? item) (integer? (:mult item)) (#{:double :triple} (:width item))]} (assoc item :id (* (:mult item) 2)))` `(save! {:mult "4" :width :single})` fails the input checks. `{:mult 5 :width :double}` passes and receives `:id 10`. section 2.1.1
A related `:post` vector checks the result after the body runs; its assertions can refer to the return value as `%`. Use `:pre` for required inputs and `:post` for required results. section 2.1.1







