Oops, yes, in my actual code it was both ":db/id", so that's not the issue.
It's really confusing - today, it works. No idea why. I restarted the REPL
multiple times to try it, and it never worked. Today it worked with the
exact same code file on the first try. After getting a very strange
exception that "clojure.core.logic.core" couldn't be compiled due to
"clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException:
clojure.core.logic.protocols.ITreeConstraint,
compiling:(clojure/core/logic.clj:1:1)
java.lang.ClassNotFoundException:
clojure.core.logic.protocols.ITreeConstraint". I'm thoroughly confused, but
I hope it will keep working.
Am Samstag, 9. April 2016 03:45:00 UTC+2 schrieb [email protected]:
>
> Hard to say, the class cast exception will have more information in it
> that could cast light on the issue. You also are using :id in one
> variation, and :db/id in the other.
>
> On 04/08/2016 05:46 PM, Daniel Ziltener wrote:
> > 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]
> <javascript:>
> > 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] <javascript:>
> > 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] <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> And what is good, Phaedrus,
> And what is not good—
> Need we ask anyone to tell us these things?
>
--
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.