Hello, I'm trying to refresh my meanderian 🙂
I'm trying to capture the ...rest of the kvs in the map (without ?route of course) and then spread it in the return structure:
(m/search preset
{:content (m/scan [?key _])
:children {?key {:navigation {:route ?route & (m/cata ?rest)}}}}
[?route {:name ?key
...?rest}])
What operators am I looking for (instead of the ...)?@lidorcg The right hand side of search rules are Clojure code. So you're looking for
(m/search preset
{:content (m/scan [?key _])
:children {?key {:navigation {:route ?route & ?rest}}}}
[?route (assoc ?rest :name ?key)])
BTW I found the docs in the GitHub repo. They're very good, I'd link to them (or at least the directory) from the main README, so they'd be more obvious to find.
should be ..!rest
https://github.com/noprompt/meander/blob/epsilon/doc/cookbook.md#tokenize-a-sequence-partitioning
(m/search preset
{:content (m/scan [?key _])
:children {?key {:navigation {:route ?route ..!rest}}}}
[?route {:name ?key
..!rest}])
is this what you had in mind?
it throws, I'm guessing something to do with search