This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-13
Channels
- # babashka (1)
- # beginners (11)
- # cider (8)
- # clj-kondo (7)
- # clojure (35)
- # clojure-italy (2)
- # clojurescript (6)
- # conjure (5)
- # datomic (10)
- # duct (7)
- # fulcro (9)
- # helix (2)
- # introduce-yourself (5)
- # lsp (3)
- # malli (7)
- # meander (3)
- # off-topic (8)
- # pathom (3)
- # podcasts-discuss (2)
- # portal (9)
- # reitit (7)
- # releases (3)
- # shadow-cljs (43)
- # sql (25)
- # tools-deps (3)
One common use case I have is editing an element within a sequence. Is there a reason something like the following isn't included in the meander API?
(m/defsyntax within [label element-pattern]
`(m/seqable ~(symbol (str "!" label "-before"))
...
~element-pattern
& ~(symbol (str "?" label "-after"))))
It allows me to write:
(m/rewrite [[1 2 3]]
(within outer (within inner (m/and ?n 1)))
(within outer (within inner (m/app inc ?n))))
That may have come across snarkily - NOT how I meant it. My real question is, is there some reason this approach isn't going to work in general?