Fork me on GitHub
#core-logic
<
2016-09-29
>
abdullahibra14:09:04

why can't i do this? (run* [q1 q2] (= q1 (* q2 q2))) ?

abdullahibra14:09:37

i got this: ClassCastException clojure.core.logic.LVar cannot be cast to java.lang.Number clojure.lang.Numbers.multiply (Numbers.java:148)

abdullahibra14:09:23

user=> (run* [q1] (== q1 1)) (1)

abdullahibra14:09:06

user=> (run* [q1 q2] (= q1 q2 1)) ClassCastException java.lang.Boolean cannot be cast to clojure.lang.IFn clojure.core.logic.Substitutions (logic.clj:425)

abdullahibra14:09:35

oh == is unification which is different

abdullahibra14:09:18

(run* [q1 q2] (== [3 q1] [q2 2])) ([2 3])