Then probably (apply concat) is better than (mapcat identity) isnt it?

What is (cons ::sentinel)? Why do you need it here?

On Wed, Feb 18, 2015 at 5:58 AM, Fluid Dynamics <a2093...@trbvm.com> wrote:

> On Tuesday, February 17, 2015 at 6:47:59 PM UTC-5, Ben wrote:
>>
>> why not (mapcat next)?
>>
>
> Yeah, that should work too, though conceptually trimming each part and
> then reflattening the partition are two separate steps of the computation.
> :)
>
>
>> The correct answer, obviously, is
>>
>> (->> s
>>   (cons ::sentinel)
>>   (partition n n nil)
>>   (map next)
>>   (mapcat identity))
>>
>> with, in this case, s = (range 1 22) and n = 5
>>
>  --
> 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 new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to