match broken on ClojureScript >= 88b36c1


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


The ClojureScript example in core.match's readme is failing at the moment, using core.match 0.2.0-alpha11:

  (:use-macros [clojure.core.match.js :only [match]]))

(match [(mod 5 3) (mod 5 5)]
      [0 0] "FizzBuzz"
      [0 _] "Fizz"
      [_ 0] "Buzz"
      :else n)> WARNING: Use of undeclared Var at line 4 
clojure.lang.ExceptionInfo: Unsupported binding form: (if (clojure.core/identical? e__4345__auto__ 0) (do (clojure.core/let [ocr-5230 (mod 5 5) ocr-5229 (mod 5 3)] (try (clojure.core/cond (clojure.core/= ocr-5230 0) (clojure.core/let [G__5226 ocr-5229] "Buzz") :else (throw 0)) (catch e__4345__auto__ (if (clojure.core/identical? e__4345__auto__ 0) (do (clojure.core/let [G__5228 ocr-5230 G__5227 ocr-5229] n)) (throw e__4345__auto__)))))) (throw e__4345__auto__)) at line 4  {:tag :cljs/analysis-error, :file nil, :line 4}

The same error is produced with any usage of match in ClojureScript AFAICT, not just the README example. However, all is well with core.match AFAICT under Clojure, and if you use older revs of ClojureScript, e.g. r1552. I did a bisect, and found that this is the first ClojureScript commit with which the example does not work:

Reverting it with master results in proper evaluation of the match, modulo the warning.

I don't see any obvious reason why the above would cause any problems, and some moderate digging based on what I know about ClojureScript didn't yield any ah-ha! moments.



Vote (0)
Watch (0)


  • Created: