core.match

Locals don't work in core.async go blocks

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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))

Activity

Hide
David Nolen added a comment -

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.

Show
David Nolen added a comment - 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.
Hide
David Nolen added a comment -
Show
David Nolen added a comment - This is a core.async bug, http://dev.clojure.org/jira/browse/ASYNC-15

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: