clara

http://www.clara-rules.org/
Joel 2019-04-26T04:21:19.001100Z

is it possible to refer to the doc string on the RHS?

2019-04-26T12:54:44.002300Z

That seems odd. Maybe with a defrule style macro you could refer to its own self var and find the doc string on there somehow.

2019-04-26T12:55:14.002900Z

Would have to test that theory out though. Can’t at the moment.

ethanc 2019-04-26T13:02:34.004200Z

Since clara allows arbitrary clojure in the rhs, most things are possible. It just seems a bit weird to do them:

(defrule a-rule
  "hello"
  [A (> x 3)]
  =>
  (println (:doc (meta #'a-rule))))

(-> (mk-session)
    (insert (->A 4))
    fire-rules)
hello

πŸ‘ 1
🎊 1
Joel 2019-04-26T23:02:06.004500Z

sweet.

Joel 2019-04-26T23:04:01.005100Z

well, i dunno like you say a bit weird, but at least possible.

Joel 2019-04-26T23:15:23.006200Z

@ethanc --- commented on ticket #428 - curious if retract rules from :rule-matches reasonably possible.