missionary
missionary copied to clipboard
Performance warning - case has int tests, but tested expression is not primitive.
This warning shows up when *warn-on-reflection*
is set to true.
It comes from amb
:
(defmacro
^{:arglists '([& forms])
:doc "In an `ap` block, evaluates each form sequentially and returns successive results."}
amb
([] `(?> none))
([form] form)
([form & forms]
(let [n (inc (count forms))]
`(case (?> (seed (range ~n))) ; <- missing `int` cast
~@(interleave (range) (cons form forms))))))
(case (int (?> (seed (range ~n)))) …)
fixes the issue
The same applies to amb=
.