This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-20
Channels
- # announcements (1)
- # beginners (65)
- # calva (16)
- # cider (44)
- # clara (16)
- # clojure (84)
- # clojure-dev (48)
- # clojure-europe (5)
- # clojure-finland (4)
- # clojure-houston (1)
- # clojure-italy (19)
- # clojure-nl (27)
- # clojure-russia (6)
- # clojure-spec (37)
- # clojure-uk (123)
- # clojured (11)
- # clojurescript (21)
- # datomic (40)
- # duct (4)
- # emacs (6)
- # figwheel (4)
- # figwheel-main (5)
- # fulcro (34)
- # jackdaw (8)
- # juxt (117)
- # kaocha (3)
- # klipse (1)
- # leiningen (33)
- # luminus (2)
- # nyc (3)
- # off-topic (29)
- # om (1)
- # pedestal (7)
- # planck (4)
- # re-frame (27)
- # reagent (8)
- # reitit (5)
- # rum (2)
- # shadow-cljs (428)
- # spacemacs (5)
- # tools-deps (15)
- # yada (6)
http://www.clara-rules.org/docs/rules/ mentions "props", but I can't see documentation for them on that page. Does anyone know what they are?
@dominicm it is a simple map, currently the only thing supported would be salience, i think. http://www.clara-rules.org/docs/conflictsalience/
However, it’s typically not recommended to write rules in a way where you have to use that
Is it possible to create rules with parameters? And be explicit about passing them in?
For rules, instead of taking a parameter, model the param as a fact inserted by a rule perhaps
Instead of
(defrule param-rule
[A (= <my-param-here> x)]
=>
<do things>)
Do
(defrule find-param
[?i <- InputFact]
=>
(insert! (map->Param (extract-data ?i))))
(defrule param-rule
[?p <- Param]
[A (= (:x ?p) x)]
=>
<do things>)
@mikerod hmm, maybe I haven't thought it through. But I want to write rules like "for every X insert 5", where I might have multiple of these inserted.