core.match

Bad interaction with core.async

Details

  • Type: Defect Defect
  • Status: Reopened Reopened
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    [org.clojure/core.async "0.1.0-SNAPSHOT"] (more specifically core.async-0.1.0-20130827.050117-78)
    [org.clojure/core.match "0.2.0-rc5"]

Description

This prints "foo" as expected:

(defn works []
  (.log js/console
        (match ["qux" "foo"]
          ["qux" "bar"] 1
          ["qux" x]     x)))

This fails with an exception: Uncaught Error: No matching clause: ["qux" "foo"]
in up-to-date Chromium

(defn fails []
  (go
   (.log js/console
         (match (<! (go ["qux" "foo"]))
           ["qux" "bar"] 1
           ["qux" x]     x))))

I don't know either core.async nor core.match very well. My best guess is a undesired interaction between the nonlocal control flow for backtracking and the core.async state machine.

Note that this is a version of core.async where http://dev.clojure.org/jira/browse/ASYNC-15 is fixed.

Activity

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: