I am trying to learn how to use core.logic. Here is a toy problem
that I am thinking about.
(run* [q]
(fresh [a b c]
(membero a [1 2 3])
(membero c [1 2 3])
(== b 2)
(!= a b)
(!= a c)
(!= b c)
(== q [a b c])))
I would like to create a function that replaces the three != lines,
something like, (distincto [a b c]) such that I could rewrite the
above problem as
(run* [q]
(fresh [a b c]
(membero a [1 2 3])
(membero c [1 2 3])
(== b 2)
(distincto [a b c])
(== q [a b c])))
I tried to write several functions but they are all end up inside some
variant of a col, [(!= a b)(!= a c)(!= b c)]. Thus, I either need
someone to help me figure out how do write the distincto function, or
what to call on [(!= a b)(!= a c)(!= b c)] to get it to work.
--
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