News for hackers. Stuff that matters.
Re:What you can write in Perl 6 today by shrughes on Friday April 24, 2009 @11:04AM (#577580)
My God. Here's their example of the "reduction meta operator".

    say [+] 1...5;      # sum
    say [*] 1...5;      # product
    say [<] @list;      # is @list strictly ordered ascendingly?
What the hell? With [*] they go for a reduction, but with [<] they go for a reduction over a zip of the list with its own tail. The behavior changes completely! How do you predict that? That's simply dumb. Extremely dumb. Things like this don't make the language complicated, they make it risky. It is risky to write Perl 6 programs. And we know programs don't get any thrill out of that.
Re:What you can write in Perl 6 today by halo on Friday April 24, 2009 @11:26AM (#577615)
The syntax seems perfectly reasonable, or even natural, to me. Perhaps you're over-thinking the specifics, or are too used to other functional programming languages where 'reduction' has a slightly different, more specific, meaning (i.e. fold).

  [+] 1...5 = 1+2+3+4+5
  [*] 1...5 = 1*2*3*4*5
  [**] 1...5 = 1**2**3**4**5
  [<] 1...5 = 1<2<3<4<5
Note that this means, unlike the normal reduce, that it follows the operator's default precedence rules, and presumably the less-than operator works similarly to Python's in that it allows comparison chaining (i.e. 1 < 2 < 3 works as you'd expect) to make the result using reduce seem natural.
Re:What you can write in Perl 6 today by chromatic on Friday April 24, 2009 @03:42PM (#578084)
You predict what a hyperoperator does by knowing what the non-hyper operator does. Your question about predictability reads to me like asking "You can modify verbs with adverbs! How in the world do you know what a verb means?"
Re:What you can write in Perl 6 today by kingkongrevenge on Friday April 24, 2009 @11:10AM (#577589)
Operators operate on the list. Conditions test the list. How is that confusing?
Re:What you can write in Perl 6 today by shrughes on Friday April 24, 2009 @11:19AM (#577599)
It's completely different behavior depending on the type of operator.

Edit: And apparently it even respects the associativity of the operator! There is nothing gained by making the language more complicated just to cut a few characters.

Re:What you can write in Perl 6 today by wolverian on Friday April 24, 2009 @02:32PM (#577950)
If you use the operator, it's (hopefully) safe to assume you know what it does. Then you should also know what interleaving the operator between the list elements does. Which is exactly what the reduction does. I don't understand your problem with it.
Re:What you can write in Perl 6 today by utx00 on Friday April 24, 2009 @11:27AM (#577618)
yeah. i don't really get what is being gained. you have to keep some much context in your head in order to write perl - as compared to python ... it's tiring (as i keep saying)
Re:What you can write in Perl 6 today by kingkongrevenge on Friday April 24, 2009 @11:21AM (#577604)
Isn't this like complaining that '[how the hell do you escape two asterisks?]' for exponentiation is too confusing?
Re:What you can write in Perl 6 today by shrughes on Friday April 24, 2009 @11:25AM (#577612)
You're not reading what I've said, are you.
Re:What you can write in Perl 6 today by scott_s on Friday April 24, 2009 @03:04PM (#578013)
It's all about context. The more of the enclosing context you need to keep in mind to understand a line of code, the more you increase the cognitive load on the programmer.