This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-11
Channels
- # announcements (3)
- # babashka (6)
- # babashka-sci-dev (37)
- # beginners (39)
- # calva (1)
- # clj-kondo (55)
- # clj-on-windows (1)
- # cljdoc (1)
- # clojure (30)
- # clojure-dev (3)
- # clojure-europe (8)
- # clojure-losangeles (1)
- # clojure-morsels (1)
- # clojurescript (26)
- # conjure (8)
- # graalvm (5)
- # helix (6)
- # hyperfiddle (12)
- # meander (6)
- # minecraft (1)
- # pathom (17)
- # polylith (1)
- # releases (2)
- # shadow-cljs (2)
- # sql (1)
- # squint (4)
Hi! I'm planning to user Meander on the back and front end, with the back end passing the necessary pieces to the front, and then the front end turning those into a valid match expression So the back end would deliver something like this (edn format),
'{:name "test", :schema [:map [:a :int] [:b :int]],
:pattern {:a ?a, :b ?b},
:target {:new-a ?a, :new-b ?b}}
And the front end turns that into a function
(fn [data] (e/match data {:a ?a, :b ?b} {:new-a ?a, :new-b ?b}))
Which could then be used.
In the back end I can just create that form and evaluate it. But I don't think I can do that from the front. Is there a way I can get this to work? Or would it just be better to have the front end pass the data to the back and have Meander do the xforms there?There is an interpreter namespace which can take a quoted form an interpret it. It's cljc so it will work everywhere.
@U06MDAPTP, out of interest, I can see in the interpreter namespace there's a finder, searcher, rewriter to match the main ns find, search, rewrite - is there a reason there isn't a matcher to go with the main ns match?