Fork me on GitHub
#clara
<
2020-09-30
>
futuro00:09:51

You probably want two rules, one for when there’s a match and one for when there isn’t (using the :not predicate)

PB15:09:20

@futuro it's possible for it to match multiple rules, but there is a preference as to which one we want to use. Right now I'm assigning a priority to the matches and then using an accumulator to select the best. Is this a valid approach?

3
mikerod19:09:49

Yes. Priority sort of logic comes up often in my past usages

mikerod19:09:05

This this was a related gist I did about it long ago. Not sure if it’s exactly the same situation though.

PB19:09:46

@mikerod that's very useful. It does look like you're using clojure maps over records?

mikerod19:09:47

@petr just for the sake of example. Either would work for the concept

PB19:09:34

Of course. I think I would prefer to use maps over records in my code-base. I was excited to see an example. I didn’t know it was possible