This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-15
Channels
- # adventofcode (121)
- # bangalore-clj (5)
- # beginners (46)
- # boot-dev (9)
- # cider (20)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (341)
- # clojure-austin (7)
- # clojure-greece (144)
- # clojure-india (3)
- # clojure-italy (5)
- # clojure-spain (1)
- # clojure-spec (34)
- # clojure-sweden (3)
- # clojure-uk (90)
- # clojurescript (24)
- # core-async (1)
- # core-logic (7)
- # cursive (108)
- # datascript (2)
- # datomic (39)
- # events (1)
- # fulcro (225)
- # graphql (8)
- # hoplon (86)
- # instaparse (12)
- # jobs-discuss (2)
- # jvm (4)
- # keechma (1)
- # lein-figwheel (2)
- # leiningen (12)
- # off-topic (26)
- # onyx (35)
- # other-languages (1)
- # pedestal (3)
- # planck (11)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # spacemacs (48)
- # specter (29)
- # sql (2)
- # test-check (1)
- # unrepl (71)
I'm using core logic to get a list of things, and infer properties about them. No answers (`nil`) is a perfectly valid answer, but I don't want to throw away an item which doesn't have an answer for a particular question. How can I do this?
@hiredman I've potentially already got an answer for my question though, so I can't do that.
user=> (l/run* [q] (l/conde [(l/== q nil)] [(l/!= q nil)]))
(nil (_0 :- (!= (_0 nil))))
user=>
(l/run*
[x q]
(l/== x 10)
(fn [a]
(l/to-stream [])))
I have a case where this could happen. How can I detect that q hasn't been bound and mark it as nil, so that I still get an answer about x?do you really really really really need to check if x is "fresh" (i guess thats what you mean with unbound)? ;; Following code loses relational properties (conde [(lvaro q) ;; q is fresh... ] [(nonlvaro q) ;; q is not fresh ])