Am 06.07.2010 um 20:09 schrieb Greg:
> On Jul 6, 2010, at 2:01 PM, Stuart Halloway wrote:This would be most likely java interop, ie. ->.
>> (1) Clojure APIs are very careful about parameter order.
> And what if you want to use a function outside of the Clojure API?
> Or a function *in* the Clojure API that doesn't follow the parameter order you want?There the main arguments are 99% of the times the first or the last ones. So -> or ->> will work.
>> (2) -> and ->> encourage chains of operations that build on that parameter order.Because consistency matters.
> Why is that important?
>> (3) I haven't seen a lot of examples where something like --> solves real problems in code.I don't think so. For example sequence or not-empty exist. But I never needed one of them in two and half years of Clojure coding. And I can't remember to have seen a single usage in other peoples code. (of course an absolutely representative sample... ;))
> I haven't coded long enough in Clojure to provide you with any examples, but it seems like hoping that the functions you're going to use are going to have the correct parameter order is silly. Why hope when you can guarantee it won't matter?
> Anyways, you haven't seen a lot of examples simply because people don't have a --> to use. Thus they're are forced to work around it, for example by replacing calls to -> or ->> with the corresponding standard calls (postfix/prefix? don't remember what that style is called).
> If it existed, you would see it being used.
> Yes, let's handicap ourselves and then disparage a useful macro as "unneeded." The -> and ->> macros aren't needed either, so why are they there? While we're at it, we should make it so that the + function takes only two arguments because any more leads to "unneeded versatility" and therefore, apparently, to "support headache." :-pCan we tune down the rethoric a little bit? These issues were discussed in depth several times now. And the fact that such a macro was not included in core should give a hint, that the pain can't be that big.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.