Closed drewverlee closed 2 years ago
the spec has a doc...
;; the specs for the ruleset macro are mostly the same as odoyle.rules/ruleset, except:
;; 1. the keys are symbols, not keywords
;; 2. :what blocks are optional
;; 3. in the :what block, only values can have bindings
;; 4. :when blocks aren't allowed
;; 5. :then blocks are required
Yeah id bindings aren't allowed because if they were, there could be more than one match for the rule, and then the question becomes how should it behave -- should the component render itself multiple times?
What you really probably want to do is write this as a normal rule (not an odoyle rum rule), then save the results to a derived fact and bring it into an odoyle rum component. For example see how i'm creating the ::all-todos
fact in a normal rule, and then bringing it into an odoyle rum rule in odoyle-rum-todo.
Thanks for the feedback. I'll use a derived fact for now. It's probably ideal for clarity.
I get a spec error (below) that says the rules binding can't be a symbol. I wanted it be a symbol so i could join it to another fact. Like
[id name name] [id height height]
to get somethings name and height. Let me know what i should do.
Here is the spec error.