Hi clj,
I'm trying to do some simple core.logic stuff. My input is a vector of
maps, which I turn into a source for core.logic using
(defn make-datamap-rel [datapile]
(fn [q]
(fn [a]
(to-stream
(map #(unify a % q) (flatten datapile))))))
Now I have written two variants for solving my problem. The first works
flawlessly:
(defn- find-cat-and-tag-id [pile cat]
(let [datamap-rel (make-datamap-rel pile)]
(run* [q]
(datamap-rel (partial-map {:id q :category cat}))
)))
The second variant throws the ClassCastException:
(defn- find-cat-and-tag-id [pile cat]
(let [datamap-rel (make-datamap-rel pile)]
(run* [q]
(fresh [qid]
(datamap-rel (partial-map {:db/id qid :category cat}))
(== q qid)
))))
I have no idea why this fails. It just doesn't make any sense. Any ideas?
Best regards,
zilti
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.