Right Right. That makes sense. Thanks.
On Thursday, 28 March 2013 17:05:58 UTC-4, David Nolen wrote:
>
> On Thu, Mar 28, 2013 at 5:01 PM, JvJ >wrote:
>
>> (defn hates-drink
>>[d]
>>(is-drink d)
>>(not-likes-drink d))
>>
>
> This is a common mistake. But consider that the following ha
On Thu, Mar 28, 2013 at 5:01 PM, JvJ wrote:
> (defn hates-drink
>[d]
>(is-drink d)
>(not-likes-drink d))
>
This is a common mistake. But consider that the following hardly makes any
sense in Clojure either:
(defn foo [a b]
(+ a b)
(- a b))
Clearly the addition is going to get
Also, on a side note, what's the deal with this:
(run* [q]
(is-drink q)
(not-likes-drink q))
(:dialogic2.bobbysally/Vodka :dialogic2.bobbysally/Daiquiri
:dialogic2.bobbysally/Beer)
(defn hates-drink
[d]
(is-drink d)
(not-likes-drink d))
(run* [q] (hates-drink q))
(_.0)
Why
Also, on a side note, the following doesn't seem to make sense:
(defn hates-drink
[d]
On Thursday, 28 March 2013 16:53:09 UTC-4, David Nolen wrote:
>
> Excellent! :)
>
>
> On Thu, Mar 28, 2013 at 4:46 PM, JvJ >wrote:
>
>> HOORAY! I did it all by myself! (with your help)
>>
>> (defn not-memb
Excellent! :)
On Thu, Mar 28, 2013 at 4:46 PM, JvJ wrote:
> HOORAY! I did it all by myself! (with your help)
>
> (defn not-membero
> [x l]
> (fresh [head tail]
> (conde
>( (== l ()) )
>( (conso head tail l)
> (!= x head)
> (not-membero x tail)
>
> On Thursday, 28 March 2013
HOORAY! I did it all by myself! (with your help)
(defn not-membero
[x l]
(fresh [head tail]
(conde
( (== l ()) )
( (conso head tail l)
(!= x head)
(not-membero x tail)
On Thursday, 28 March 2013 16:21:41 UTC-4, David Nolen wrote:
>
> My point here isn't to tickle your brain bu
My point here isn't to tickle your brain but point out that there's a bit
of misunderstanding about how core.logic works and what facilities you
should use to handle your problem.
It should be clear soon enough that it will be very difficult to formulate
your problem in terms of facts or conde.
Y
Btw if I sounded sarcastic I wasn't. I actually would love to spend time
thinking about it.
On Thursday, 28 March 2013 16:12:06 UTC-4, JvJ wrote:
>
> Any other hints? I'd love to spend time on this brain tickler, but I have
> other things to do.
>
> On Thursday, 28 March 2013 16:05:00 UTC-4, J
Any other hints? I'd love to spend time on this brain tickler, but I have
other things to do.
On Thursday, 28 March 2013 16:05:00 UTC-4, JvJ wrote:
>
> Alright, I'm starting to get it but not quite there
>
> (run* [q]
> (fresh [x]
> (conde
>( (== q 1) )
>( (== q 2) )
>( (==
Alright, I'm starting to get it but not quite there
(run* [q]
(fresh [x]
(conde
( (== q 1) )
( (== q 2) )
( (== q 3) )
( (== q 4) ))
(conde
( (== x 3) )
( (== x 4) )
( (== x 5) )
( (== x 6) ))
(!= q x)))
(1 1 1 2 1 2 2 2 3 4 3 3 4 4)
On Thursday, 28 Mar
This won't work. Rewrite this example w/o using facts and try to understand
why it won't work.
David
On Thu, Mar 28, 2013 at 3:37 PM, JvJ wrote:
> Here's what I'm trying...
>
> (facts a [[1]
> [2]
> [3]
> [4]])
> nil
> (facts b [[3]
> [4]
> [5]
> [6]])
>
> (run*
Here's what I'm trying...
(facts a [[1]
[2]
[3]
[4]])
nil
(facts b [[3]
[4]
[5]
[6]])
(run* [q]
(a q)
(fresh [x]
(b x)
(!= q x)))
(1 1 2 1 1 2 2 2 3 4 3 3 4 4)
So what the heck is this all about?
On Thursday, 28 March 2013 15:17:24 UTC-4, David Nole
negation is hard. This has come up several times. It may be possible to a
better form of negation as failure via delays, but this not high on my
current priority list. Patches to make it work are of course most welcome.
On Thu, Mar 28, 2013 at 2:54 PM, JvJ wrote:
> Thanks, but there's another a
You can express not member of list B with disequality. I could show you how
to do this, but you'd probably learn more by giving it a try yourself ;)
On Thu, Mar 28, 2013 at 2:47 PM, JvJ wrote:
> In core.logic, how do the following: "Give me everything that is a member
> of list A and not a memb
Actually, I found this post:
https://groups.google.com/forum/?fromgroups=#!topic/clojure/hz63yeQfiQE
But the not operator has to be used first to ensure that the term is
ground. It was a little confusing.
On Thursday, 28 March 2013 14:54:31 UTC-4, JvJ wrote:
>
> Thanks, but there's another asp
Thanks, but there's another aspect to this.
Let's say I had two relations A and B, and I wanted all q such that
(A q)
(not (B q))
How would that work?
On Thursday, 28 March 2013 14:50:33 UTC-4, Jim foo.bar wrote:
>
> clojure.set/difference
> 'membero' combined with its negated form?
>
> Jim
>
clojure.set/difference
'membero' combined with its negated form?
Jim
On 28/03/13 18:47, JvJ wrote:
In core.logic, how do the following: "Give me everything that is a
member of list A and not a member of list B"?
--
--
You received this message because you are subscribed to the Google
Groups "C
In core.logic, how do the following: "Give me everything that is a member
of list A and not a member of list B"?
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from ne
18 matches
Mail list logo