<< 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

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


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 []
    (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))

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 Thu Oct 19 13:22:53 CDT 2017 using JIRA 4.4#649-r158309.