clojure - core.logic unification matches value in map but not key -


i don't understand why following 2 examples, first 1 returns correct value (1), while second returns (). i'd have expected result (:key) or exception can't find solution, not empty list.

(l/run* [q]   (l/== {:key 1} {:key q}))  ;; doesnt work  (l/run* [q]   (l/== {:key 1} {q 1})) 

i haven't found documented intended behaviour or not, looking @ source code, (limited) understanding, looks unification of maps happens values, not keys.

as implemented in unify-with-map*, when core.logic finds key :key in first map, looks value in second, doesn't find it, , bails on unification. since there no solutions, @arthur ulfeldt said, end ().


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -