Fork me on GitHub
#cljs-dev
<
2021-05-18
>
dnolen00:05:12

they involve the fact that fns in loops capture locals

dnolen00:05:48

praise to Canary for catching this stuff 🙂

dnolen00:05:12

need to think about it a little bit - unless some else gets to it first!

dnolen00:05:50

left a comment in the issue about my analysis

mfikes00:05:53

Yeah, it seems to involve a loop and the need for referring to someting in a fn in that loop

mfikes00:05:11

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)) [[]])

dnolen00:05:59

that's fine

dnolen00:05:10

the or is simpler and if we fix that one, the for one should be fixed too

mfikes00:05:16

The lambda inside the loop seems to have the gensym injected into it as an arg because it is in scope there

dnolen00:05:19

and it's good to have more patterns in the unit tests

dnolen00:05:31

the problem is and/or do the gensym

dnolen00:05:42

but the optimizing and/or pass rewrites the let + gensym away

dnolen00:05:49

but it's too late for inner analysis

dnolen00:05:53

which already saw those locals

dnolen00:05:43

... probably a second pass is sufficient

dnolen00:05:31

hrm - though that's kind of ugly because of termination

dnolen00:05:51

a good excuse to write a walker now that we have :children

dnolen00:05:57

which can take passes to apply at each node