clara

apbleonard 2022-02-27T10:48:04.508509Z

Hi - has anyone tried building auto generated documentation for Clara rulesets? I'm thinking of a Javadoc style HTML listing of all rules in the set and the facts they use and/or insert - and similarly for all facts - that you could browse around?

2022-02-28T14:51:14.032939Z

I think that this an interesting idea. I think that on the LHS of a rule it is achievable statically inspect the forms to generating information on the facts that are involved and matched on. The rules themself are compiled in a way that already must be able to inspect it in this regard. The RHS (action) of the rule though is fairly free form clj-code, so there is no guarantee that they can be inspected statically to know which sorts of facts are inserted. Of course if you constrain this either via a custom DSL, or just a convention, you can set up rules in a way that the types of facts that are RHS insert! (or similar) are inspectable.

apbleonard 2022-02-28T18:48:21.803319Z

Yes that was along the lines I was considering. Our rules and facts are mostly very plain... if A & B insert! X .. but hopefully it would be possible to do in a fairly general form 🤔

👍 1