cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dnolen 2021-05-18T00:00:12.006700Z

they involve the fact that fns in loops capture locals

dnolen 2021-05-18T00:03:48.007Z

praise to Canary for catching this stuff 🙂

dnolen 2021-05-18T00:04:12.007700Z

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

dnolen 2021-05-18T00:04:50.008600Z

left a comment in the issue about my analysis

mfikes 2021-05-18T00:04:53.008700Z

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

mfikes 2021-05-18T00:05:11.009Z

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

dnolen 2021-05-18T00:05:59.010Z

that's fine

dnolen 2021-05-18T00:06:10.010500Z

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

mfikes 2021-05-18T00:06:16.010900Z

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

dnolen 2021-05-18T00:06:19.011Z

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

dnolen 2021-05-18T00:06:31.011300Z

the problem is and/or do the gensym

dnolen 2021-05-18T00:06:42.011600Z

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

dnolen 2021-05-18T00:06:49.011900Z

but it's too late for inner analysis

dnolen 2021-05-18T00:06:53.012100Z

which already saw those locals

dnolen 2021-05-18T00:08:43.012800Z

... probably a second pass is sufficient

dnolen 2021-05-18T00:31:31.013200Z

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

dnolen 2021-05-18T00:31:51.013600Z

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

dnolen 2021-05-18T00:31:57.013900Z

which can take passes to apply at each node