Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:master clojurescript, commit 9abeb143f6
Description
When executing following code
(loop [i 10
v [0]
v2 [0]]
(if (pos? i)
(let [j i
x (map #(+ j %) v)]
(recur (dec i) x (map #(+ j %) v2)))
(concat v v2)))
Clojure produces
(55 55)
(10 55)
Forcing realization of lazy seqs produces correct output (55 55) on both environments.
(loop [i 10
v [0]
v2 [0]]
(if (pos? i)
(let [j i
x (doall (map #(+ j %) v))]
(recur (dec i) x (doall (map #(+ j %) v2))))
(concat v v2)))
This is actually due to a bug in analyze-let whereby functions involved in init-exprs would not close over earlier bindings. The attached patch fixes this.