On Friday, December 13, 2002, at 10:59 PM, Piers Cawley wrote:
<edited to fix a minor typo>map { .[0] } sort { $^a[1] cmp $^b[1] } map { $_ => some_transform($_) } grep /.../, @arrayhappily stays as it is; I fail to see what recasting that as map { .[0] } <- sort { $^a[1] cmp $^b[1] } <- map { $_ => some_transform($_) } <- grep /.../ <- @array or any other 'noisy' suggestion buys us. It just seems like the wrong kind of Laziness to me.
My only concern is that the first implies (as it does in perl5) yet more special behaviors attached to the {...} brackets. Either "no comma is needed after a closure", or "no comma needed after the first arg of the specific functions named C<map>, C<grep>, ...
I'm worried that in attaching even _more_ specialness to curlies (which are already highly (impossibly?) magical), we're setting ourselves up for some hurt down the road. It was OK in perl5, but I don't know if it's OK in perl6.
Mind you (purely devil's advocate), I'm not entirely sure the R-to-L syntax truly _needs_ to be in Perl6. It's true I use it all the time, but I can retrain to use L-to-R method calls with little effort.
If we have a post-given, e.g. C<map {...} given @a> or C<map {...} is given @a>, I think that gives us R-to-L without any special {...} rules at all.
MikeL