Smart! That's just what I want to do.
Thanks, Leif and the author of Prismimatic.
Best Regards,
Yoshinori Kohyama
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from
I think functions like this become pretty clear if you pull out 'unfold'
and 'fold' utilites, like:
https://github.com/Prismatic/plumbing/blob/master/src/plumbing/map.clj#L42
Their 'flatten' generates a seq [path value] pairs, and 'unflatten' turns
that back into a map. With these, you can wri
Hi clojurians.
I have functions for nested maps.
They obviously have a same structure.
Does anyone teach me a way to generalize them with a macro, a function or
an existing API?
(defn flatten-map [m kf vf]
(into {}
((fn g [kv n]
(if (map? n)
(apply concat
(ke