Open swannodette opened 14 years ago
I've considered the same thing, and may add it. The only reason I haven't is that it would have to be a macro, not a function. This means you wouldn't be able to use it like a function in all but the most basic case. For example, you couldn't pass match?
to another function or curry it with something like
(def my-matcher (partial match? [java.lang.String & _]))
No one expects to this type of thing with an if
, cond
, or when
form.
Illumination: "The only reason I haven't is that it would have to be a macro, not a function. This means you wouldn't be able to use it like a function in all but the most basic case." Thanks Drew!
You have if-match, but why not add a match? predicate.