Hi,

Am 06.07.2010 um 20:09 schrieb Greg:

> On Jul 6, 2010, at 2:01 PM, Stuart Halloway wrote:
> 
>> (1) Clojure APIs are very careful about parameter order. 
> 
> And what if you want to use a function outside of the Clojure API?

This would be most likely java interop, ie. ->.

> 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. 
> 
> Why is that important?

Because consistency matters.

>> (3) I haven't seen a lot of examples where something like --> solves real 
>> problems in code.
> 
> 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.

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... ;))

> 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." :-p

Can 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.

Sincerely
Meikel

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