Fork me on GitHub
#clojure-bay-area
<
2021-02-12
>
benwen07:02:57

@sekao 🙏 thank you for the video presentation. Uploaded to YouTube: https://youtu.be/27KuJU8r4-U (currently still processing ATM)

benwen07:02:13

(oh, just realized you have it on your channel too. I linked to your YT channel.)

ghosttoaster17:02:22

@sekao is it possible to see what rules names have been added to a session? I thought (:rule-ids @*session) would do the trick but it doesn't seem to work?

sekao18:02:07

in the most recent version it is :rule-name->node-id so it would be (-> @*session :rule-name->node-id keys) . i would never do a breaking change in the public api but since that's an internal detail i did rename it :P

3
ghosttoaster22:02:27

Thank you! Having a lot of fun exploring this. Do I have to match every entity for queries to work? Lets say have a hero entity with attributes {::x 10 ::y 10 ::health 100} and a background tile entity with attributes {::x 100 ::y 80 ::color "green"}. Should I be able to match on just the ::x and ::y attributes and get both entities back?

ghosttoaster23:02:21

Ok. It definitely looks like partial matches are a thing but my queries are only working for entities inserted after the query-rule has been added.

ghosttoaster23:02:55

I did try to o/fire-rules but that didn't seem get the older entities picked up. It was only after I re-inserted the entities did they get picked up. Is that the way things are supposed to work?

sekao09:02:56

that's right, a fact will only be retained if it matches at least one rule, and if you add a fact before a rule is added, it won't be in the results when you call query-all with that rule name

👍 3