Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
The second nom/hash throws an exception, because the nom/hash constraint is ran before the predc one.
(is (= (run* [q]
(nom/fresh [x]
(fresh [y]
(predc y nom? `nom?)
(nom/hash y x)
(== y 'foo))))
()))
(is (= (run* [q]
(nom/fresh [x]
(fresh [y]
(nom/hash y x)
(predc y nom? `nom?)
(== y 'foo))))
()))
Perhaps, we can generalize the notion of hash.
Applied in https://github.com/clojure/core.logic/commit/43d325bd8e3770f3483cc8be7d332adfae3a6a96