This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-28
Channels
- # announcements (12)
- # babashka (87)
- # beginners (84)
- # calva (22)
- # circleci (4)
- # clj-kondo (46)
- # cljdoc (6)
- # cljsrn (15)
- # clojure (87)
- # clojure-europe (18)
- # clojure-uk (7)
- # clojurescript (20)
- # community-development (3)
- # conjure (1)
- # cursive (13)
- # datomic (14)
- # events (7)
- # fulcro (27)
- # graphql (31)
- # helix (8)
- # jobs-discuss (1)
- # lsp (43)
- # malli (11)
- # meander (64)
- # off-topic (7)
- # pathom (26)
- # polylith (9)
- # practicalli (2)
- # re-frame (33)
- # reagent (2)
- # reitit (5)
- # releases (2)
- # rewrite-clj (2)
- # shadow-cljs (69)
- # specter (5)
- # sql (1)
- # tools-deps (85)
- # tree-sitter (1)
- # vim (3)
Hello! I’m trying to rewrite an infix pattern into prefix, like:
'[1 2 3 4 ! 5 6 7] => '[1 2 3 (! 4 5) 6 7]
I’m using rewrite
but I can’t figure out the rule. Have I missed a doc page?@ggaillard Here are a couple approaches.
;; Before 0.0.626
(let [xs [1 2 3 4 '! 5 6 7 9]]
(m/rewrite xs
[!head ... ?x '! ?y . !tail ...]
[!head ... ('! ?x ?y) . !tail ...]))
;; =>
[1 2 3 (! 4 5) 6 7 9]
;; 0.0.626 and later
(let [xs [1 2 3 4 '! 5 6 7 9]]
(m/rewrite xs
[& ?head ?x '! ?y & ?tail]
[& ?head ('! ?x ?y) & ?tail]))
;; =>
[1 2 3 (! 4 5) 6 7 9]
Cool! I'll try this. Thank you very much!
Perhaps we could look at the commit history between the last tagged release, parse it, and make a changelog?
IMHO changelog is not needed. Meander can safely be considered a niche of clojure niche library.
The few people who use it are certainly smart enough to be able to figure out the changes from the commit history 🙃
Jimmy recently cast it as “avant-garde” which I thought was both high-praise and certain doom. 🙂
But here, there's no fooling around, and you can be happy about it. It's our, or at least mine, secret super weapon and super toy.
You don't have many followers in the meandering church, but anyone who uses a meander will certainly appreciate it.
If you wanted to be the idol of the crowds, you should have written terminal spinners in javascript, or something equally groundbreaking.
I’ve been thinking that its probably time for me to just make an actual language out of this thing.
Primarily, I want to build something that is only focused on manipulating data between two pipes.
meander is already like a programming language, and writing macros that use meander to write code for meander is an inception that bends the mind.
Anyone thats applied an identity in algebra/trigonometry etc understands term rewriting.
Of the things I've noticed that sell meander well is the size of the buildsize for CLJS
And on top of that it tries to generate the best code it can considering its shoot-from-the-hip design. 😛
for more difficult things, I'm almost sure that the resulting code will be smaller than normal, as cljs has a lot of kinks and things to avoid
i have a stupid question, why meander use lazy collections and not for example transducers?
Meander compiles things like (let [?x TARGET] ,,,)
instead of (assoc state '?x TARGET)
and, it could be my lack of imagination, but the former is hard to shoe into a transducer approach.
OK. Thats good information. Honestly, I think this project needs to be more accessible and problems like these should be easier to resolve with some help.
The approach I’ve tried with zeta
works really well for interpretation but has proven to be too slow for macro compilation.
We'll see soon if it's too difficult. If I can handle redoing it through metadata then that means anyone could
I agree that Meander is secret sauce, I’ve used it for some things where I just end up staring at the solution in awe cause it’s so clear and concise
@noprompt, is there any way to debug meander? To understand what is going on and refer to the expanded code somehow?