core.match

clojure.match doesn't match maps correctly inside go blocks

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:

Description

;; Tested in ClojureScript only, #clojure on freenode reports things works in Clojure.

;; This works, {:bye ...} is the first thing inside match's match list:
(go (println
(match {:bye ["cruel" "world"]}
{:bye [a b]} (str "Goodbye " a " " b)
{:hello [a b]} (str "How are you doing " n "?"))))

;; This works (no go block), {:bye ..} is second:
(println
(match {:bye ["cruel" "world"]}
{:hello [a b]} (str "How are you doing " n "?")
{:bye [a b]} (str "Goodbye " a " " b)))

;; This doesn't: Uncaught Error: :clojure.core.match/not-found is not ISeqable
;; indicating that (match ...) is probably returning not-found.
(go (println
(match {:bye ["cruel" "world"]}
{:hello [a b]} (str "How are you doing " n "?")
{:bye [a b]} (str "Goodbye " a " " b))))

Activity

Hide
Uday Verma added a comment -

Sorry for posting code as text, attached file (bug.cljs) has the same stuff.

Show
Uday Verma added a comment - Sorry for posting code as text, attached file (bug.cljs) has the same stuff.
Hide
David Nolen added a comment -

core.match is mostly incompatible with core.async until core.async is further improved.

Show
David Nolen added a comment - core.match is mostly incompatible with core.async until core.async is further improved.
Hide
David Nolen added a comment -

See the core.async JIRA for other issues like this one.

Show
David Nolen added a comment - See the core.async JIRA for other issues like this one.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: