I'm very new to core.match and just started playing around. Doing so, I came up with this example:
This errors with the message — "IllegalArgumentException Argument must be an integer: :clojure.core.match/not-found clojure.core/even? core.clj:1351)". The problem is that the keyword :clojure.core.match/not-found is passed to the :guard function odd? which passes it to even?.
I can fix it by ensuring the my guard only gets an integer like so:
But is it really intensional that guards have to deal with :clojure.core.match/not-found? In my opinion, in the example above all maps that are matched have integer values, so it seems plausible that I can have a guard that only accepts integers.
Clojure 1.7.0 beta4, core.match 0.3.0-alpha3
You can actually use that :clojure.core.match/not-found special value to make a kind of perverted map pattern that matches only if it doesn't match like so.
But I guess (and hope) nobody relies on such a strange behavior.