For me, I'd like it if the core functions had the "data" as the first argument, but have a special function—I can't come up with a better name than "partial-2"—so that (partial-2 function opt1 opt2 opt3) is equivalent to (fn [data] (function data opt1 opt2 opt3)). That way, I could do things like (map (partial-2 s/split #"\n" 30) vector-of-strs) without breaking .
In fact, something like partial-2 would be useful right now for functional composition with str-utils2's functions. On Aug 19, 6:56 pm, CuppoJava <patrickli_2...@hotmail.com> wrote: > I'm also looking for a satisfactory answer to this problem. > > So far I'm slightly in favor of putting the "data" (ie. the sequence/ > collection/object ...) first in the argument list and the "parameters" > following. > > This is because there's so many core functions that take a function > and arguments and applies this to some data. These functions always > assume the "data" comes first in the argument list. > > If I were to have my way, I would redefine all the clojure.core > functions to assume the "data" is the last argument instead of the > first. (this includes ->) This way they would play nice with both > partial and ->. > > I'm not sure if there's a serious drawback to that suggestion that I > haven't noticed though. > > -Patrick --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---