Thank you for your input Thomas.
All replies have definitely been very useful :)
Cheers,
Ryan
On Tuesday, December 10, 2013 1:57:38 PM UTC+2, Thomas Heller wrote:
>
> Oh nvm, just saw that it was suggested before.
>
> But maybe this is new:
>
> (def m
> {"outerKeyA" {:innerKeyA {"string id" {
Oh nvm, just saw that it was suggested before.
But maybe this is new:
(def m
{"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
"outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)
(defn nested-seq [m]
(for [[outer-key collections] m
[collection-name collection] collecti
FWIW you can simplify the nested doseqs like this
(doseq [[outer-keys collections] m
[collection-name collection] collections
[string-id data] collection]
;; do stuff with the above
)
HTH,
/thomas
On Wednesday, December 4, 2013 12:05:14 AM UTC+1, Ryan wrote:
>
> Hi a
I've seen postwalk and prewalk but never really played around with them so
I will give it a shot.
Thanks for your input!
Ryan
On Tuesday, December 10, 2013 10:29:51 AM UTC+2, Jeroen van Dijk wrote:
>
> Don't forget about the option of walking over a map by using
> clojure.walk/postwalk or cloj
Don't forget about the option of walking over a map by using
clojure.walk/postwalk or clojure.walk/prewalk
I use these functions often lately. Especially useful if you have to update
values in your map and they could occur anywhere. It is a bit tricky to get
working at first, because the return va
Thanks guys for the useful answers :)
Ryan
On Wednesday, December 4, 2013 1:27:57 AM UTC+2, James Ferguson wrote:
>
> `update-in` could be helpful, depending on what exactly you're doing.
>
> (doseq [keyA keys, keyB otherkeys]
> (update-in m [keyA keyB] some-function))
>
> On Tuesday, December
`update-in` could be helpful, depending on what exactly you're doing.
(doseq [keyA keys, keyB otherkeys]
(update-in m [keyA keyB] some-function))
On Tuesday, December 3, 2013 6:05:14 PM UTC-5, Ryan wrote:
>
> Hi all,
>
> I am trying to figure out a better way to loop the following map than
> u
Tree-seq? But then, if the data is structured so each level has a distinct
purpose, that's not really a great fit.
Perhaps we need a for/doseq analog of assoc-in, update-in, etc.?
At the very least I think this might work:
(doseq [[outer-keys collections] m
[collection-name collection] c
I was going to type in the example with multiple bindings, but this
will probably be more helpful:
http://blog.jayfields.com/2013/05/clojure-combining-calls-to-doseq-and-let.html
On Tue, Dec 3, 2013 at 6:05 PM, Ryan wrote:
> Hi all,
>
> I am trying to figure out a better way to loop the following