This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-11
Channels
- # adventofcode (108)
- # announcements (4)
- # aws (11)
- # babashka (39)
- # beginners (199)
- # calva (12)
- # clj-kondo (17)
- # cljs-dev (1)
- # clojure (115)
- # clojure-dev (9)
- # clojure-europe (98)
- # clojure-italy (17)
- # clojure-nl (4)
- # clojure-norway (3)
- # clojure-seattle (7)
- # clojure-sweden (6)
- # clojure-switzerland (5)
- # clojure-uk (15)
- # clojurescript (41)
- # code-reviews (36)
- # conjure (7)
- # datomic (1)
- # emacs (1)
- # events (1)
- # fulcro (26)
- # graalvm (2)
- # helix (35)
- # jackdaw (2)
- # jobs (9)
- # jobs-discuss (5)
- # lambdaisland (2)
- # meander (24)
- # off-topic (80)
- # pathom (22)
- # pedestal (1)
- # portal (20)
- # re-frame (3)
- # releases (1)
- # reveal (13)
- # rewrite-clj (1)
- # shadow-cljs (8)
- # specter (5)
- # sql (4)
I'm curious what you guys think about enhancing the m/$
operator to avoid subtrees matching a pattern. I have a tree that contains information at one semantic level that I'd like to use to rewrite all the nodes at that same semantic level. It would be convenient to use m/$
to match all the nodes at that level but it traverses into lower levels and, thus, ends up matching too much.
Could you share a simplified example? (or the real one if you want)
An example would be great but, to summarize, are you asking if the operator can do a top down traversal and stop once a match has been made?
Yep. That's exactly what I'm looking for.
I can provide an example of what I'm trying to do this weekend
@U06MDAPTP I'm not entirely sure we're on the same page. I'd like the operator to do a top traversal matching everything for p1
and stop when it reaches p2
I need to think about this a bit more because I would like to have this model work in both directions e.g. the dual of this, I think, would be to construct a tree.
that would be pretty cool
In the mean time I know we can fill in the blanks with something that does what you’re looking for. There are a few thing ahead in the queue though.
I'm using meander to parse honeysql and rewrite it. Currently, I'm avoiding generating an AST. But, eventually, I'm going to need to convert between an AST and honeysql. Your dual top-down
operator could be very handy for this, I imagine
It seems like the dual would be grow a tree with the node pattern until it matches the stop pattern, however, there needs to be a notion of where the children go.
I haven't touched the strategy stuff yet. That's a this weekend project 🙂
Sure. My hope is that, eventually, what is in the main namespace, the interpreter work, and the strategies can all be joined together in a super nova of fun times 😛
I have to say, meander has been a game changer for me. The bulk of my application code is generating SQL statements from fragments of SQL that know how to project various bits of data. SQL is a bear to compose but meander has given me a way of taming it without completely losing my mind.
That’s really great to hear. If you’re ever open to it — and there is zero pressure when I say this — you could always drop some snippets of what you’re doing the in the cookbook etc.
Yep. That's on my to-do list