Fork me on GitHub

Think I hit another issue trying to update in place. I thought I could get away with it for unconditional facts, but it appears that when I have multiple LHS bindings on a rule that does a retract! followed by an insert-unconditional!, the RHS fires for all bindings, so the retracts all occur before other rules fire that would potentially invalidate the LHS on the first rule after a subset of firings, based on those retractions.


@dave.dixon if you get into the business of doing unconditional things, you’ll have to control rule order more. This can be done with salience and possibly “blocker” fact patterns.


It seems like avoiding this sort of thing can be a guiding principle for data modeling. For example, the existence of an entity might be unconditional, but the facts describing that entity may have more detailed logical relationships. Trying to group those facts as attributes under a single entity fact map or record leads to the headaches I'm encountering. But maybe if I separate them so that they can be separately inserted/retracted, things will be cleaner. Giving clara-eav a try for this purpose.