Any suggestions meander for test expression matching?
(is (m/match x (a b c) true _ nil))
works but is a bit unsatisfying because if it doesn’t match doesn’t print out x
Inverting to
(is (not (m/match method (a b c) false _ method)))))
Gives a better error message, but has double negative output which is a bit confusing )(is (= :match (m/match method (a b c) :match _ method)))
^^ this isn’t bad 🙂(defmacro is-match? [x pattern]
`(is (= (m/match ~x ~pattern :match ~'_else ~x) :match)))
o_O(is-match? method (a b c))
(is-match? method (defn (m/pred symbol? ?fn-name) (m/pred string? ?doc-string) & _))
@timothypratley Shared a cool idea: https://github.com/noprompt/meander/issues/116 I’d be interested in hearing what others think.
https://github.com/timothypratley/happygapi/blob/master/dev/happy/beaver.clj <-- some heavy meandering going on in here 😉
oooo nice 🙂
I love that I can actually read most of this code and see whats going without actually knowing what its purpose is. 🙂
Also, I think you’ll be really happy to know that in zeta
you’ll be able to pattern matching and substitute strings too so you won’t need to do ~(str ,,,)
.
Oh and you’ll be able to m/let
on the RHS. 🙂