Do :guard predicates really need to handle :clojure.core.match/not-found?

Description

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.

Environment

Clojure 1.7.0 beta4, core.match 0.3.0-alpha3

Assignee

David Nolen

Reporter

Tassilo Horn

Labels

None

Approval

None

Patch

None

Priority

Major
Configure