meander

2021-11-04T17:50:26.015600Z

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

2021-11-04T17:51:44.016900Z

e.g

noprompt 2021-11-04T17:52:07.017300Z

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))

2021-11-04T17:52:09.017600Z

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

2021-11-04T17:52:37.017800Z

heh, I forgot about the existence of m/$

2021-11-04T17:53:20.018300Z

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

noprompt 2021-11-04T17:54:38.019500Z

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

2021-11-04T17:55:11.019800Z

Now I know 🙂

2021-11-04T17:55:51.020Z

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

noprompt 2021-11-04T18:02:19.022300Z

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

noprompt 2021-11-04T18:04:12.024300Z

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

noprompt 2021-11-04T18:05:31.025600Z

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

noprompt 2021-11-04T18:05:57.026Z

Going forward, it should probably be a separate package.