It's generally doing logic programming on a large map... I want to find all x such that y and z, with joins across the map. So yes.
Two possible solutions:
1. The naive parsing. If a variable which could be bound is mentioned in the body, make it bound first.
This would be wrong if we let-bind a variable name which is bound elsewhere.
2. Metadata on the function indicating what it needs (in other words, manual).
3. A new syntax, (m/app' f pat & args)
, where no variables are bound during compilation of f
, and f
is applied to the match value and the args (which could be already-bound) and matched to pat.
We could also try giving logic variables a priority.