core.async

"dynamic binding + parking" removes top values of dynamic bindings outside

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    org.clojure/core.async 0.3.443
    Clojure 1.8.0
    Java HotSpot(TM) 64-Bit Server VM 1.8.0_51-b16
    MacOS 10.12.6

Description

Parking inside binding block removes current values of dynamically bound vars.

Example:

(require '[clojure.core.async :as async :refer [go <!]])

(def ^:dynamic d)

(go
  (binding [d :bound]
    (println d)
    (<! (async/timeout 10))
    (println d)))

Here is the output:

:bound
#object[clojure.lang.Var$Unbound 0x15f8a952 Unbound: #'user/d]

Activity

Hide
Simon Skorokhodov added a comment -

I found an easier way to reproduce the problem:

(require '[clojure.core.async :as async :refer [go <!]])

(def ^:dynamic d)

(go
  (binding [d :bound]
    (println d)
    (<! (async/timeout 10))
    (println d)))

The output:

:bound
#object[clojure.lang.Var$Unbound 0x15f8a952 Unbound: #'user/d]

Unfortunately I don't know how to edit the description of an issue.

Show
Simon Skorokhodov added a comment - I found an easier way to reproduce the problem:
(require '[clojure.core.async :as async :refer [go <!]])

(def ^:dynamic d)

(go
  (binding [d :bound]
    (println d)
    (<! (async/timeout 10))
    (println d)))
The output:
:bound
#object[clojure.lang.Var$Unbound 0x15f8a952 Unbound: #'user/d]
Unfortunately I don't know how to edit the description of an issue.
Hide
Nicola Mometto added a comment -

I've edited the description for you

Show
Nicola Mometto added a comment - I've edited the description for you

People

Vote (2)
Watch (5)

Dates

  • Created:
    Updated: