<< Back to previous view

[CLJ-1299] Binding conveyance seems to be broken as of 1.6.0-alpha2 Created: 21/Nov/13  Updated: 02/Dec/13  Resolved: 02/Dec/13

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: Release 1.6
Fix Version/s: Release 1.6

Type: Defect Priority: Blocker
Reporter: Peter Taoussanis Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Clojure 1.6.0-alpha2
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)


Approval: Vetted

 Description   

With Clojure 1.5:

(def ^:dynamic *num* 1)
(binding [*num* 2] (future (dotimes [_ 10] (println *num*))))

Behaves as expected: "2" prints 10 times. With Clojure 1.6.0-alpha2 the same form will print "1"s off the main thread.

This seems to be an interaction between loop/recur and the binding conveyance: the num binding does convey without the loop:

(def ^:dynamic *num* 1)
(binding [*num* 2] (future (println *num*))) ; Prints "2" even with 1.6.0-alpha2


 Comments   
Comment by Alex Miller [ 21/Nov/13 9:02 AM ]

I can confirm that the patch for this ticket is the one that introduced this behavior in 1.6:
http://dev.clojure.org/jira/browse/CLJ-1125

Comment by Alex Miller [ 02/Dec/13 9:57 PM ]

Marking as a dup now handled by the new patch in CLJ-1125 (and test included there).

Generated at Sat Dec 20 17:51:37 CST 2014 using JIRA 4.4#649-r158309.