On Wed, May 04, 2005 at 09:34:28AM -0400, Aaron Sherman wrote: : On Wed, 2005-05-04 at 09:06, Larry Wall wrote: : > On Wed, May 04, 2005 at 09:00:46AM -0400, Aaron Sherman wrote: : > : That said, let me try to be helpful, and not just complain: : > : : > : $sum = (+) @array; : : > It's certainly one of the ones I considered, along with all the other : > brackets, and |+|, plus variants : : I could see [], but the others don't have any mnemonic for : list-opification. : : Hmmm... : : $sum = [+] @array : : Nice.
I just thought that'd be visually confusing in a subscript: @foo[0..9; [;[EMAIL PROTECTED]; 0..9] But maybe it's not so bad. : > It just seemed like it'd be a little : > visually confusing where you want to turn the list op into a function : > : > $sum = (+)(@array); : : $sum = [+](1,2,3); : : Not bad, not bad. : : > But maybe that's not a problem. But there are other potential : > ambiguities besides visual, I suspect. : : Juerd mentioned x, which is certainly one such. Any \w+ keyword is going : to be a problem, but I think you can make the case for any: : : sub infix:foo($a,$b){...} : : enforcing correct handling of: : : sub list:[foo]([EMAIL PROTECTED]) {...} Yes, but it is rather ambiguous for any unary that can take $_, like [int] but that's not an infix, and there isn't that much overlap, so it could probably be made to work, and not be too confusing, at least until someone adds an infix:<int> operator... Larry