This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-28
Channels
- # announcements (92)
- # aws (7)
- # babashka (13)
- # beginners (42)
- # clj-kondo (9)
- # cljdoc (25)
- # clojure (156)
- # clojure-europe (19)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-sg (1)
- # clojure-spec (3)
- # clojure-uk (6)
- # clojurescript (21)
- # copenhagen-clojurians (1)
- # cryogen (3)
- # cursive (9)
- # datahike (3)
- # datomic (5)
- # emacs (8)
- # graphql (4)
- # introduce-yourself (3)
- # jobs (2)
- # malli (1)
- # meander (8)
- # nrepl (3)
- # off-topic (8)
- # om-next (2)
- # pathom (11)
- # rdf (5)
- # reagent (59)
- # remote-jobs (4)
- # shadow-cljs (8)
- # tools-build (23)
- # vim (16)
hello, I’m looking for some operation to sub match
, I’m not sure if there is one, but if it existed I expected to working something like this:
(def items
{1 {:a "a"
:b "b"}})
(m/find {:id 1}
{:id (m/sub-match (m/app items ?item)
{:a ?a})}
?a)
is there an operator or way to do that?
in terms of text, I want to extract some data point, get over a fn (using m/app
) and them match again over that result
@U066U8JQJ every problem can be solved with a finite number of m/cata
(def items
{1 {:a "a"
:b "b"}})
(m/rewrite {:id 1}
{:id (m/app items ?item)}
(m/cata [:sub-match ?item])
[:sub-match ?x]
[:after-sub-match ?x])
Sometimes, I also shove more information into the data structure in question. In your case, it looks a little like a join.
nice! the integrated index solution is neat 🙂