hi iβm trying to do a transform where i need to select a single value out of a list.. something like
{:a "a"
:b [{:name "pickme" :value "foo"} {:name "somethingelse" :value "bar" ..]}
;becomes
{:my/a "a"
:my/b "foo"}
; have tried various things with ... scan, etc but i'm obivously not doing the right thing
{...
:b [{:name "pickme" :value !value} ...]}
etc(m/rewrite {:a "a"
:b [{:name "pickname" :value "foo"} {:name "somthingelse" :value "bar"}]}
{:a ?a
:b [{:value !value} ...]}
[{:my/a ?a
:my/b !value} ...])
;; => [#:my{:a "a", :b "foo"} #:my{:a "a", :b "bar"}]Wait, I misread
You want to get whatever has pickme
right.
i got something sorta working with cata
(m/rewrite {:a "a"
:b [{:name "pickme" :value "foo"} {:name "somthingelse" :value "bar"}]}
{:a ?a
:b (m/scan {:name "pickme" :value !value})}
{:my/a ?a
:my/b !value})
;; => #:my{:a "a", :b "foo"}ok cool i thought i tried that but at this point who knows lol
one sec
ah i was using match instead of rewrite
ugh
thx!
Scan does not work with match, but with find it does.
(m/find {:a "a"
:b [{:name "pickme" :value "foo"} {:name "somthingelse" :value "bar"}]}
{:a ?a
:b (m/scan {:name "pickme" :value !value})}
{:my/a ?a
:my/b !value})
gotcha. still working through what works with what lol
and if you don't need to collect multiple values, it's a better idea to use ?value instead of !value
The learning curve of meander is very steep, I recommend to start with find, only after that play with rewrite, and finally recursion with cata and with
yeah thatβs what threw me a little
because i know i wanted a single value ?β¦ but in that context most of the examples are the memory vars !..
gotca
will use that heuristic going forward
memory vars will always work too, but they are obviously slower
iβll maybe add that to the docs lol. because it seems simple for a lot of common cases but, yeah there are quite a few dangerous left turns lol
Has anyone had a chance to double check if whats on epsilon right now works for them e.g. it passes tests, etc.?
1 sec
doxa uses meander very heavily and it also seems to work.
Awesome. What font is that? I looks almost like Monoid.
Iosevka
[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "sans"
no-cv-ss = true
[buildPlans.iosevka-custom.variants]
inherits = "ss04"
[buildPlans.iosevka-custom.ligations]
inherits = "dlig"Ah, nice. I knew it looked familiar. π
A good font is essential, I admire people from the previous era who had to look at jagged angular fonts on crt monitors.
The past couple years have been generous for monospace typography. There are so many fantastic options available.
Also, I will probably cut a release tomorrow.
@huxley After that I think we can get back on track with the fast flag.
great:+1: