On Sat, Jan 26, 2002 at 04:52:53PM -0800, Larry Wall wrote: > @result = map -> $a; $b { $a op $b } @a; @b;
Something seems wrong with this, but I can't quite put my finger on what it is. I think it's the -> directly after map - -> looks too much like an operator. And even if you read "->" as the natural "to", you get "map to $a and $b, perform $a op $b, for @a and @b" I'd be happier with map @a; @b -> $a; $b { $a op $b } ("Map elements of @a and @b to $a and $b, and do '$a op $b'") but the semicolons seem blecherous there. But this is starting to look more like ML than Perl. > That's starting to get up there on the grottiness meter. Since semicolon > is probably just separating lists within lists, perhaps > > @result = map -> $a; $b { $a op $b }, [@a], [@b]; But (@a; @b) *is* a list of two lists, so you'd want to keep that. > is a valid alternative. But it's still not as comely as the C<for>, > which never needs the parens, since it knows the {} is coming. > > Perhaps we shouldn't be using ; for this. Given hyperoperators, I wonder if we can actually drop map. -- Calm down, it's *only* ones and zeroes.