meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
timothypratley 2020-03-06T03:34:24.123300Z

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

timothypratley 2020-03-06T03:35:43.123400Z

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 )

timothypratley 2020-03-06T03:40:12.123600Z

(is (= :match (m/match method (a b c) :match _ method)))
^^ this isn’t bad 🙂

timothypratley 2020-03-06T03:49:45.123800Z

(defmacro is-match? [x pattern]
  `(is (= (m/match ~x ~pattern :match ~'_else ~x) :match)))
o_O

timothypratley 2020-03-06T03:50:01.124Z

(is-match? method (a b c))

timothypratley 2020-03-06T03:54:59.124200Z

(is-match? method (defn (m/pred symbol? ?fn-name) (m/pred string? ?doc-string) & _))

noprompt 2020-03-06T03:58:06.125200Z

@timothypratley Shared a cool idea: https://github.com/noprompt/meander/issues/116 I’d be interested in hearing what others think.

timothypratley 2020-03-06T05:53:49.126Z

https://github.com/timothypratley/happygapi/blob/master/dev/happy/beaver.clj <-- some heavy meandering going on in here 😉

timothypratley 2020-03-06T16:34:10.126900Z

oooo nice 🙂

noprompt 2020-03-06T06:13:38.126200Z

I love that I can actually read most of this code and see whats going without actually knowing what its purpose is. 🙂

noprompt 2020-03-06T06:14:55.126400Z

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 ,,,).

noprompt 2020-03-06T06:16:52.126600Z

Oh and you’ll be able to m/let on the RHS. 🙂

timothypratley 2020-03-06T16:34:10.126900Z

oooo nice 🙂