When evaling this super simple core.match expression I get:
(match [(class "3.14")]
[Integer] "Integer"
[Double] "Doubler")
; => "Integer"
How can this be correct, am I missing something fundamental about core.match? Doing a macroexpand-1 on this form gives me:
=> (clojure.core/let [ocr-2751 (class "3.14")] (clojure.core/let [Integer ocr-2751] "Integer"))
Any pointers appreciated.
Like @Arthur said, normally
core.matchwill bind values to symbols. However, apparently, it first tries to match against locals. Who knew?Anyway, bind the classes as locals in a
letbefore matching and you're good to go: