On 13 déc, 17:03, Michel Salim <michel.syl...@gmail.com> wrote: > On Dec 13, 8:28 am, lpetit <laurent.pe...@gmail.com> wrote:> Hello, > > > I wanted to know if I was alone thinking that 'mapcat' should better > > have been named 'catmap' ? > > When reading code, this looks more natural because it resembles the > > functional composition of the 2 functions : (cat (map ...)) > > mapcat, I take to read "map, and then cat the results"
Yes, but (cat (map)) reads "map, and then cat the results". When I read lisp code, I'm used to know that the innermost function (the function name closest to the arguments) applies first, and it is generally also the rightmost function name ... > -- if we're > reversing the order, and breaking with older dialects, could we call > it flatmap instead, like Scala? Well, I think "flat" is recursive on the entire tree, where "cat" (for concat) does just concat the lists that compose the argument list. So flatmap and catmap would be 2 different functions for 2 different purposes ? --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---