Fork me on GitHub
#clara
<
2019-12-28
>
futuro00:12:41

I have three rules which have the same fact expressions in their LHS, and I’d like to extract them to aid in reuse.

futuro00:12:04

I’m not at a computer, but I can write up a little snippet later if that’d make it clearer.

ethanc00:12:01

I would usually use an intermediate fact in that scenario, one rule that inserts the fact constrained by the common lhs and then downstream rules can rely on the presence of the intermediate fact

👍 4
futuro00:12:24

Hmmm, yeah, that could work. I suppose you’d put any shared fields you needed into this shared fact, which would allow downstream rules to pull them back out, yeah?

ethanc01:12:31

Yes, they would carry what's needed. In some cases simply wrapping the whole fact might make sense

👍 4
futuro01:12:09

Swanky, thank you @ethanc !

👍 12