This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-17
Channels
- # announcements (1)
- # babashka (26)
- # beginners (28)
- # biff (8)
- # calva (45)
- # cider (62)
- # clara (3)
- # clj-kondo (34)
- # cljfx (1)
- # clojure (72)
- # clojure-belgium (1)
- # clojure-canada (13)
- # clojure-conj (2)
- # clojure-dev (3)
- # clojure-europe (19)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-uk (8)
- # clojurescript (10)
- # clr (36)
- # core-logic (13)
- # cursive (2)
- # datalevin (2)
- # datomic (23)
- # fulcro (13)
- # graphql (23)
- # instaparse (1)
- # introduce-yourself (4)
- # jobs (1)
- # jobs-discuss (13)
- # lsp (30)
- # luminus (7)
- # malli (2)
- # off-topic (57)
- # polylith (13)
- # portal (5)
- # reagent (32)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (25)
- # xtdb (12)
The inspection tools might also be of interest in a case like this @pdmct depending on what exactly you’re trying to accomplish. http://www.clara-rules.org/docs/inspection/ and http://clara-rules.org/apidocs/0.21.1/clojure/clara.tools.inspect.html#var-inspect, particularly :fact->explanations in the return value from the inspect function. They are designed as a public API, primarily for debugging but it could be used other ways as well potentially. There is more information there than just the rulename as well, such as the facts that caused the insertion. If you want the rulename in the fact for downstream logic in clara or otherwise adding it in the rule RHS seems reasonable. If you have to do a lot of it writing your own macro on top of defrule to make that information available wouldn’t be too difficult I think (or your own function if you use the data-oriented APIs, you don’t have to use the macros) or as Ethan says you could use the internal Clara var (but that could potentially change).
So I have started using this (I'm not sure why I haven't in the past but oh well) with djblue/portal for inspecting the data. The experience for debugging and working out issues is now really good. I would definitely recommend using portal for debugging and inspecting the session state. (in fact it would make a nice addition to the user docs to add that!) thanks for the reminder.