Fork me on GitHub
#meander
<
2021-11-04
>
ribelo17:11:26

Is it possible to use a meander to collect all the symbols from the given data? maybe a meander strategy? not really necessary, but it seems like a cool puzzle

noprompt17:11:07

Sure, you could use

(m/search x
  (m/$ (m/symbol _ _ :as ?symbol))
  ?symbol)
which will effectively do
(filter symbol? (tree-seq coll seqable? seq x))

ribelo17:11:09

(collect-args '[1 ?a 2 [?b {:b ?c}]])
;; => [?a ?b ?c]

ribelo17:11:37

heh, I forgot about the existence of m/$

ribelo17:11:20

I have already tried meander.strategy/bottom-up, but not much has come out of it

noprompt17:11:38

Strategies like bottom-up are mostly for doing postwalk types of transforms.

ribelo17:11:11

Now I know 🙂

ribelo17:11:51

the strategy is not well described at all, and some of the functions are not in the documentation at all, but maybe when I get the hang of it I will do a PR

noprompt18:11:19

Yeah. The strategy namespace hasn't gotten as much attention because it hasn't be promoted so much.

noprompt18:11:12

Actually, most of it was originally written by Brandon Bloom and then I started building on top of it.

noprompt18:11:31

But the closer m/rewrite got to where I wanted it, I had fewer use cases for that namespace.

noprompt18:11:57

Going forward, it should probably be a separate package.