Skip to content

1.1.0

Compare
Choose a tag to compare
@oakes oakes released this 25 May 00:57
· 7 commits to master since this release

This release enables attributes to be matched with binding symbols in the :what block. Up until now, only the id and value could have a binding symbol.

This can be a helpful tool for debugging or tracking. You can now make a quick rule that prints out every time a fact with a given id and/or value is inserted, regardless of the attribute.

You can even make a tuple like [id attr value], which matches on every fact! Why is this useful? It usually isn't...but one cool use case is when you want to retract every fact with a given id. Now, you can make a rule like this:

[:what
 [id ::remove? true]
 [id attr      value]
 :then
 (o/retract! id attr)]

Then, when you insert [123 ::remove? true], the rule will trigger on every fact whose id is 123 (thanks to the join on id) and they will all be retracted.