<< Back to previous view

[MATCH-85] Locals don't work in core.async go blocks Created: 27/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Closed
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Michael Alyn Miller Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None
Environment:

clojure 1.5.1, core.match 0.2.0-rc5, core.async 0.1.0-20130726.150120-62



 Description   

Looks like the same problem described in MATCH-82 happens in both Clojure and ClojureScript if the match block is made from inside of a go block. For example:

(defn correct []
  (let [x 1]
    (match 2
      x 1
      _ 2)))

(defn incorrect []
  (go
    (let [x 1]
      (match 2
        x 1
        _ 2))))

(defn -main
  [& args]
  ;; "correct 2"
  (println "  correct" (correct))

  ;; "incorrect 1"
  (go (println "incorrect" (<! (incorrect))))
  (Thread/sleep 1000))


 Comments   
Comment by David Nolen [ 28/Jul/13 6:42 PM ]

This ticket needs more information, core.match and core.async provide pretty sophisticated macros so I'm not surprised that there may be some strange interactions between the two. core.async likely rewrites let statements and this probably interacts badly with locals matching.

Comment by David Nolen [ 30/Jul/13 12:23 PM ]

This is a core.async bug, http://dev.clojure.org/jira/browse/ASYNC-15

Generated at Fri Jul 25 11:09:02 CDT 2014 using JIRA 4.4#649-r158309.