This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-05
Channels
- # announcements (5)
- # beginners (49)
- # boot (9)
- # calva (34)
- # cider (9)
- # clara (18)
- # clj-kondo (1)
- # cljsrn (7)
- # clojure (196)
- # clojure-dev (4)
- # clojure-europe (11)
- # clojure-france (3)
- # clojure-nl (13)
- # clojure-norway (2)
- # clojure-spec (8)
- # clojure-uk (85)
- # clojurescript (87)
- # clojurex (202)
- # core-logic (6)
- # data-science (6)
- # datomic (9)
- # dirac (1)
- # duct (93)
- # emacs (9)
- # events (1)
- # fulcro (22)
- # hoplon (30)
- # jackdaw (10)
- # keechma (1)
- # leiningen (5)
- # malli (17)
- # off-topic (9)
- # other-languages (3)
- # pedestal (7)
- # re-frame (3)
- # reagent (5)
- # reitit (9)
- # remote-jobs (6)
- # rewrite-clj (80)
- # ring (2)
- # shadow-cljs (191)
- # tools-deps (54)
- # vim (14)
- # xtdb (7)
Is this the indentation metadata you’re referring to @dominicm? https://docs.cider.mx/cider/indent_spec.html I’ve generally been satisfied with the default indentation in Cider when writing rules, are there examples of cases where the indentation is strange? My initial instinct if this sort of thing is desired would be to look for/create an extension mechanism for it so various development environments could be supported without everything needing to be in the main codebase (this is orthogonal to whether it would be in the main repo IMO and this could be separately considered).
Cursive looked at implementing the spec, I'm not sure if it happened though. It hasn't seen much adoption in other editors.
I’m trying out Clara right now. Is there a way to get all the current facts from a session? I’ve tried various inspection functions, and come up short.
- inspect/explain-activations
- fact-graph/session->fact-graph
- inspect/inspect
I can get most facts from the above functions. What I am missing is facts inserted directly into the session, which haven’t themselves fired any rules. This would be just for debugging the rules, not for production queries.
I don’t want to write a query which includes all Fact types, I’m looking for a simple way to enumerate all current facts in the system.
Any ideas?
I’ll try out the Object query, thanks for the pointer. This is only for debugging, so I’m not worried about performance
Object query is straightforward. It’s slow because it always is activated by all working memory changes
On the subject of the query performance, something that may be counterintuitive is that the cost comes from the presence of the query in the rules session, not the query call itself. In essence when fire-rules is called the query results are computed. Agreed that a query on Object is the simplest way to get all facts in the session if the perf hit doesn't matter e.g. in testing.