Uploaded image for project: 'Clojure'
  1. CLJ-1299

Binding conveyance seems to be broken as of 1.6.0-alpha2

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Duplicate
    • Affects versions: Release 1.6
    • Fix versions: Release 1.6
    • 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
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ptaoussanis Peter Taoussanis
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: