Re: Easiest way to map over leaf nodes of nested sequence

2013-08-28 Thread Gary Fredericks
the function cleans up slightly with cond->. I don't think you can get around having to specify how to recognize a leaf, for any general solution. On Tue, Aug 27, 2013 at 10:27 PM, JvJ wrote: > I suppose that works, but it seems a little inelegant to do this: > (prewalk #(if (sequential? %) % (

Re: Easiest way to map over leaf nodes of nested sequence

2013-08-27 Thread JvJ
I suppose that works, but it seems a little inelegant to do this: (prewalk #(if (sequential? %) % (f %)) xs) instead of just (prewalk f xs) On Tuesday, 27 August 2013 20:06:38 UTC-7, gfredericks wrote: > > Clojure.walk > On Aug 27, 2013 10:05 PM, "JvJ" > wrote: > >> I feel like this question has b

Re: Easiest way to map over leaf nodes of nested sequence

2013-08-27 Thread Gary Fredericks
Clojure.walk On Aug 27, 2013 10:05 PM, "JvJ" wrote: > I feel like this question has been asked about a trillion times, but I was > having a hard time finding a straight answer. Is there a really > straightforward way in the standard library or in one of the contrib > libraries to do something li