This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-19
Channels
- # admin-announcements (2)
- # beginners (25)
- # boot (93)
- # cider (2)
- # clara (2)
- # cljs-dev (63)
- # cljsjs (3)
- # cljsrn (38)
- # clojure (142)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-czech (1)
- # clojure-dev (7)
- # clojure-greece (1)
- # clojure-russia (170)
- # clojure-spec (11)
- # clojure-uk (65)
- # clojurescript (46)
- # clojurex (1)
- # code-reviews (3)
- # cursive (11)
- # datomic (35)
- # euroclojure (6)
- # events (2)
- # flambo (2)
- # hoplon (115)
- # instaparse (11)
- # jobs (21)
- # jobs-rus (3)
- # lambdaisland (2)
- # off-topic (17)
- # om (35)
- # onyx (161)
- # planck (1)
- # protorepl (7)
- # random (1)
- # re-frame (31)
- # reagent (19)
- # ring-swagger (21)
- # rum (5)
- # spacemacs (3)
- # specter (25)
- # test-check (20)
- # testing (7)
- # untangled (2)
- # yada (50)
@flavio : So the or is on two different conditions on the same fact? It sounds like this need not fire twice. Or conditions in the constraints on a single fact condition don’t produce multiple firings, that is only for :or conditions that are actually part of the Rete network. I think of something like [:or B C] as firing for all elements of the union of B and C, to put it differently, whereas conditions like [B (or pred1 pred2)] are still one set that just calls clojure.core/or to determine what facts of type B should be members of that set. A concrete example might help; https://github.com/rbrush/clara-examples/blob/master/src/main/clojure/clara/examples/booleans.clj#L41 will fire once per matching Order, while https://github.com/rbrush/clara-examples/blob/master/src/main/clojure/clara/examples/booleans.clj#L19 will fire once per matching NewCustomer or ValuedCustomer. If you have a single fact that you’re trying to test it sounds like you want something more like new-or-valued-customer-basic-coupons in that examples page; the :or condition functionality is really just shorthand for writing multiple rules in a single defrule in the code. Does this help? It is a bit confusing because we’re using the same word “or” to mean fundamentally different things.
Also, you may have seen http://www.clara-rules.org/docs/booleans, but if you haven’t that could be helpful. The key point though is that that only addresses booleans created like https://github.com/rbrush/clara-examples/blob/master/src/main/clojure/clara/examples/booleans.clj#L19 ; the way to distinguish the cases visibly is what is a clojure keyword (:or :and) versus a normal Clojure function call like (or… or (and...