Mike-
Jeremy's got a great explanation of this, which I'll paraphrase, but the
discussion went through lots of iterations. Think of the ^ as a carat or
thumbtack, holding the place for later variables. Then, consider the
parallels:
Placeholder Variable
Anonymous ^_ $_
Numbered ^1 ^2 $1 $2
Named ^bob ^jim $bob $jim
When you look at the symmetry this way, I think it makes a ton of sense
and even makes currying a lot more understandable. In fact, I think the
syntax is very Perlish.
I think after you look at it a little more, the confusion about the xor
goes away. The only other real alternative was *, which is
multiplication, so that wasn't any better (actually way worse because
binary xor isn't used nearly as frequently, plus currently * is a unary
typeglob too).
-Nate
Michael Fowler wrote:
>
> I like the idea of currying, it seems powerful and Perlish in many ways.
> However, I don't like the currying operator chosen, because of it's ugliness
> (IMHO), and its potential for ambiguity (human, not necessarily parser).
>
> So, here is my proposal to change the operator.
>
> from to
> ------ ---------
> ^_ ^^
> ^2, ^3 ^^2, ^^3
> ^named ^^named
>
> To me, it stands out better, and is less likely to cause the programmer
> looking at it to scratch his head and try to figure out if it's an xor or a
> curry. I did it myself several times, and I consider myself at least a
> competent programmer.
>
> I know I'm coming into this late, I apologize. I did not follow much of the
> discussion. I've tried to catch up on the arguments via the archive as best
> I could, but I may have missed something.
>
> Michael
> --
> Administrator www.shoebox.net
> Programmer, System Administrator www.gallanttech.com
> --