core-logic

swizzard 2017-07-27T00:16:31.924242Z

hi all, i’m working my way through the reasoned schemer with core.logic; i’ve read https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer, but i’m still a little confused?

swizzard 2017-07-27T00:18:25.949069Z

specifically by the use of the non-prefixed cond, e.g.:

swizzard 2017-07-27T00:20:04.971158Z

also, i’m not sure how to get conde to properly evaluate:

2017-07-27T00:53:31.397477Z

(run* [q] (conde [fail succeed] [succeed fail]))

2017-07-27T01:14:43.668456Z

@swizzard The book examples aren’t really great in isolation. I’d have to check my copy of the book when I get home to see the context of this.

2017-07-27T01:15:07.673297Z

But the above is how to run an equivalent core.logic conde

swizzard 2017-07-27T16:28:23.402124Z

when/why would you use lcons instead of just list?

2017-07-27T16:51:55.204848Z

I don’t think I’ve ever used lcons

2017-07-27T16:52:10.213106Z

Probably you’d just use it when trying to do examples from minkanren

swizzard 2017-07-27T16:59:05.453235Z

@norman that’s kind of what i assumed, but wanted to be sure, thanks 🙂

2017-07-27T17:00:36.508242Z

We (ThreatGRID) have probably one of the only production apps with a signficant core.logic component, so I’m heavily biased towards the practical things

swizzard 2017-07-27T17:01:26.538134Z

i hope you don’t get annoyed by me asking a bunch more dumb questions, because i’m only on chapter 2 of TRS

2017-07-27T17:01:40.546336Z

That’s 2 more chapters than most 🙂

swizzard 2017-07-27T17:03:04.596312Z

i have vague dreams of using CLP and maybe rete to build an “is my rpg breakable?” tester

swizzard 2017-07-27T17:03:14.602624Z

so i figure i need to actually understand logic programming first