This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-06
Channels
- # announcements (1)
- # aws (36)
- # babashka (105)
- # beginners (53)
- # calva (27)
- # cider (5)
- # clj-kondo (10)
- # clojure (232)
- # clojure-europe (4)
- # clojure-italy (6)
- # clojure-losangeles (9)
- # clojure-nl (3)
- # clojure-sanfrancisco (3)
- # clojure-uk (124)
- # clojured (3)
- # clojurescript (57)
- # clojutre (1)
- # core-async (9)
- # core-logic (1)
- # cryogen (23)
- # cursive (35)
- # datomic (12)
- # duct (4)
- # events (1)
- # figwheel-main (3)
- # fulcro (9)
- # graalvm (31)
- # jobs (1)
- # jobs-discuss (85)
- # kaocha (11)
- # leiningen (11)
- # luminus (19)
- # malli (47)
- # meander (12)
- # nrepl (8)
- # off-topic (32)
- # pathom (4)
- # pedestal (2)
- # reagent (7)
- # ring-swagger (1)
- # schema (3)
- # sql (5)
- # tools-deps (114)
- # vim (17)
- # xtdb (12)
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 😉
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 ,,,)
.
oooo nice 🙂