Fork me on GitHub

@eraserhd Not sure I understand the question either, but the API with queries is that if you call the query function on a rules session after firing rules, the query results will reflect all insertions/retractions prior to the fire-rules call. Under the hood, queries are basically a rule LHS and the results are computed as part of fire-rules - the query function in clara.rules really is more of a “retrieve query results” function than a “run query” in that way. If your concern was performance, there are optimizations that could be made around deferring some query matching work to later in the fire-rules, thus avoiding the need to retract query matches that are invalidated, but that hasn’t been implemented. I’ve found it isn’t often an issue and in the few cases where it was it was fairly easy to work around.