Join GitHub today
%(), @(), $() are evil/weird #1946
I thought I had filed something like the following as an issue before, or at least raised it, but I've failed thus far to find it. These really need to be known as evil/weird so at the risk of filing a duplicate...
Here's a design doc reference: http://design.perl6.org/S05#line_3070
It doesn't expect the list that
Or really confused:
Now let's really pile on.
Some are recommending
Docs even refer to
Also, use of
(I noticed someone somewhere wondering why the warning message on
'a' ~~ m:g/ . /; say @() =:= $/; # True
But it's still thoroughly weird.
Though not as weird as
'a' ~~ m:g/ . /; say $()
No such method 'ast' for invocant of type 'List'
These have been on the 6.d-prep chopping block for quite a while: https://github.com/perl6/6.d-prep/blob/master/TODO/FEATURES.md#remove--magicalness-from--and-
So, let me see if I got all the facts lined up:
That form could be the coercion syntax
Hah, I didn't even think about this case, because we're not even looking to parse a term in that construct. :)
That's because the block was taken as the block for
Correct, which is why I said “other cases”. I guess my point is that there is some perceived ambiguity, especially if you're just starting out with the language (even though for the compiler that is not an issue).
Ah. That's right.
Ah, so I had written something about this before (in the RT, which I'd failed to find). Thanks Zoffix several times over.
Everyone else, thank you too and I'm closing this on the basis it's fully covered by the existing RT and 6.d item and new issues to doc these three and to redo related style guide aspects.