Work on the following example in Clojure in Action (p. 63):
(defn basic-item-total [price quantity]
(* price quantity))
(defn with-line-item-conditions [f price quantity]
{:pre [(> price 0) (> quantity 0)]
:post [(> % 1)]}
(apply f price quantity))
REPL score:
(with-line-item-conditions basic-item-total 20 1)
As a result, the following exceptions are thrown:
Don't know how to create ISeq from: java.lang.Long
[Thrown class java.lang.IllegalArgumentException]
It seems that an exception is thrown after the application procedure is evaluated.
source
share