On Aug 19, 5:16 pm, Sean Devlin <francoisdev...@gmail.com> wrote:
> I suspect I am in the minority with my next concern.  The library
> takes the string as the first argument, so that it works well with the
> -> macro.  When I originally wrote my string library, I favored this
> type of signature too.
>
> However, over time I found this signature did not work well with my
> code.  Often I would write something like this
>
> (map (comp (partial map (comp   #(str2/drop % 2)
>                                 #(str2/take % 5)))
>                 #(str2/split % #"\t"))
>         (split a-string #"[\n\r]"))
>
> This felt a little forced, and the methods don't compose very well.
> As such, I re-wrote my lib with the string call at the end of the
> function.  The main reason was I felt that this approach works better
> with the partial function.

Hi Sean,

Good point. It's always a question whether argument order should favor
"partial" or "->".  In clojure.core, the sequence functions generally
put the sequence argument last, while other collection functions (like
conj, assoc) put the collection first.

Anyone else have an opinion on this?

-SS
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to