This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-22
Channels
- # architecture (30)
- # beginners (56)
- # cider (16)
- # cljs-dev (12)
- # cljsrn (21)
- # clojure (169)
- # clojure-austin (1)
- # clojure-estonia (1)
- # clojure-italy (3)
- # clojure-russia (1)
- # clojure-spec (56)
- # clojure-uk (46)
- # clojurescript (53)
- # consulting (3)
- # core-async (3)
- # cursive (14)
- # data-science (16)
- # datascript (1)
- # datomic (26)
- # defnpodcast (11)
- # docs (3)
- # emacs (6)
- # fulcro (4)
- # graphql (24)
- # hoplon (8)
- # instaparse (4)
- # java (2)
- # jobs (1)
- # jobs-rus (1)
- # jobs_rus (1)
- # keechma (1)
- # luminus (2)
- # lumo (1)
- # mount (36)
- # off-topic (30)
- # om-next (5)
- # onyx (29)
- # precept (23)
- # re-frame (20)
- # reagent (2)
- # remote-jobs (9)
- # ring (2)
- # ring-swagger (3)
- # rum (3)
- # shadow-cljs (100)
- # spacemacs (17)
- # sql (10)
- # timbre (2)
- # unrepl (29)
- # yada (2)
I found an example that it is not: https://dev.clojure.org/jira/browse/CLJS-2476
Cool. Fortunately, an extremely easy patch is possible by simply adding disallowing-recur
.
I'm putting that together, and with three changes can catch all of these problematic cases
(loop [] (try (recur)))
(loop [] (try (catch js/Error t (recur))))
(loop [] (try (catch :default t (recur))))
(loop [] (try (finally (recur))))
Wow. It caught something interesting:
(loop [] (binding [*foo* 1] (recur)))
This fails in Clojure and will also in ClojureScript because binding
expands to try
.@dnolen With respect to this bit ^ about binding. We actually (incorrectly) use this construct here https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/js.cljs#L707 Would you prefer that a fix for that problematic recur be done as a separate patch, or combined with the one I'm putting together for https://dev.clojure.org/jira/browse/CLJS-2476 ?