<< Back to previous view

[MATCH-67] match broken on ClojureScript >= 88b36c1 Created: 14/Feb/13  Updated: 28/Jul/13  Resolved: 15/Feb/13

Status: Closed
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Chas Emerick Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


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

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

(match [(mod 5 3) (mod 5 5)]
      [0 0] "FizzBuzz"
      [0 _] "Fizz"
      [_ 0] "Buzz"
      :else n)

ClojureScript:foo.bar> WARNING: Use of undeclared Var foo.bar/e__4345__auto__ 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.

Comment by David Nolen [ 15/Feb/13 5:21 PM ]

fixed http://github.com/clojure/core.match/commit/3bab92b6620dccdcb9e55941af4599e3adf78a6e

Comment by Chas Emerick [ 15/Feb/13 7:51 PM ]

Thanks for looking at this!

Generated at Sun Oct 22 19:54:51 CDT 2017 using JIRA 4.4#649-r158309.