This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-29
Channels
- # aws (6)
- # beginners (33)
- # bitcoin (2)
- # boot (22)
- # carry (2)
- # cider (5)
- # clara (21)
- # cljs-dev (115)
- # cljsrn (40)
- # clojure (161)
- # clojure-dev (73)
- # clojure-italy (38)
- # clojure-russia (88)
- # clojure-spec (123)
- # clojure-uk (58)
- # clojurescript (88)
- # core-async (26)
- # cursive (5)
- # datascript (18)
- # datomic (26)
- # hoplon (50)
- # java (2)
- # jobs (1)
- # leiningen (10)
- # lumo (1)
- # off-topic (18)
- # om (9)
- # onyx (26)
- # parinfer (13)
- # pedestal (41)
- # quil (1)
- # re-frame (27)
- # reagent (21)
- # ring-swagger (11)
- # slack-help (3)
- # spacemacs (8)
- # specter (5)
- # sql (42)
- # timbre (1)
- # uncomplicate (7)
- # untangled (3)
- # videos (1)
- # yada (26)
Hi everyone - I develop Cursive, and I’ve been chatting to @zylox about the possibility of adding support for the Clara macros to Cursive.
Since Cursive indexes source, it needs some support to understand macro forms - I’m planning to open an API for that, but that’s way off since it’s a large project.
One thing I’m interested in is being able to add support using grammars migrated from specs for macros, since I expect there will be more of them in the future.
Has anyone investigated or thought about creating specs for the Clara macro forms? That would be a big help in adding support for them to Cursive.
As well as selfishly meaning that I can actually try to migrate some macro specs to Cursive - I haven’t seen any in the wild yet.
Since the macro forms also seem quite complex, it seems like having specs for them would also be generally useful to developers using Clara.
@cfleming Hey, cool idea. I haven't really used specs for macros yet, but I think it would be straightforward to do so for Clara's macros. The structure is pretty well defined (the defrule and defquery macros already have a schema defining their return values) and has been stable for some time.
@ryanbrush Nice. So is there actually a grammar for the macros themselves anywhere? I see some railroad docs, but they seem incomplete.
We had written quite a bit of error handling code for malformed defrule macros to make it easier to debug, but we don't have a formal grammer besides the (incomplete) EBNF we used for the railroad docs.)
Are there examples of Clara rules in any OSS projects? I don’t work with it myself so I’m not sure how a lot of the tricky cases (destructuring etc) work.
Sort of. The precent project (https://github.com/CoNarrative/precept) uses Clara, but is more of a wrapper so isn't the most common usage.
The best place for examples is probably the clara-examples project itself: https://github.com/cerner/clara-examples/tree/master/src/main/clojure/clara/examples
Hi, I'd like to use Clara in my app which uses Component. I'm currently scratching my head on how I can create a rule that when matched writes to a channel supplied by Component when the application starts. Would anyone be able to give me guidance on how I might do it?
Okay silly me, I'm adding the required components as facts and I can pull them out as needed in the rule for use in the right hand side.