This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-21
Channels
- # announcements (13)
- # babashka (63)
- # babashka-sci-dev (64)
- # beginners (37)
- # biff (1)
- # calva (10)
- # cider (7)
- # clj-kondo (15)
- # cljsrn (6)
- # clojure (26)
- # clojure-dev (10)
- # clojure-europe (34)
- # clojure-france (9)
- # clojure-nl (2)
- # clojure-norway (36)
- # clojure-uk (5)
- # clojurescript (142)
- # community-development (1)
- # conjure (3)
- # datalevin (5)
- # datalog (2)
- # datomic (5)
- # events (11)
- # fulcro (40)
- # gratitude (9)
- # guix (32)
- # honeysql (10)
- # jobs (2)
- # lsp (32)
- # malli (15)
- # meander (5)
- # membrane (43)
- # missionary (3)
- # nextjournal (9)
- # off-topic (38)
- # pathom (3)
- # polylith (30)
- # portal (78)
- # programming-beginners (4)
- # quil (6)
- # re-frame (20)
- # reagent (21)
- # remote-jobs (2)
- # shadow-cljs (7)
- # tools-deps (6)
- # xtdb (23)
Hi folks, I’ve been looking for an excuse to use Meander for a while and I think I have a good use case now. One question I’m struggling with: for boring reasons, I’d like to define my input and output patterns in advance, separate from when I actually invoke Meander. But I have some transformation functions I want to use in the output pattern that rely on runtime context (in my case, a DB connection): an example input pattern:
{:id ?epic-id
:input {:team ?team-id}}
an example output pattern:
{:id (resolve-as-type db :entity-type/epic ?epic-id)
:input {:team_id (resolve-as-type db :entity-type/team ?team-id)}})
My question is: is there some way to pass in parameters to an invocation of m/match
(or any of the other top-level Meander macros) that are then available in the patterns? (e.g., the equivalent to the :in
clause of a Datomic query).and if not, what kind of patterns do people have for threading runtime context down into function calls in an output pattern?
You can use unquote ~
in most pattern places, and in the substitution of m/rewrite
👍 1