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

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -