Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion --> macro proposal
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Meikel Brandmeyer  
View profile  
 More options Jul 6 2010, 5:20 pm
From: Meikel Brandmeyer <m...@kotka.de>
Date: Tue, 6 Jul 2010 23:20:46 +0200
Local: Tues, Jul 6 2010 5:20 pm
Subject: Re: --> macro proposal
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 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.