they involve the fact that fns in loops capture locals
praise to Canary for catching this stuff 🙂
need to think about it a little bit - unless some else gets to it first!
left a comment in the issue about my analysis
Yeah, it seems to involve a loop and the need for referring to someting in a fn in that loop
I'll drop this in the description for the and
case
((fn [s] (for [e s :when (and (sequential? e) (every? (fn [x] x) e))] e)) [[]])
that's fine
the or is simpler and if we fix that one, the for one should be fixed too
The lambda inside the loop seems to have the gensym injected into it as an arg because it is in scope there
and it's good to have more patterns in the unit tests
the problem is and/or
do the gensym
but the optimizing and/or pass rewrites the let + gensym away
but it's too late for inner analysis
which already saw those locals
... probably a second pass is sufficient
hrm - though that's kind of ugly because of termination
a good excuse to write a walker now that we have :children
which can take passes to apply at each node