On Tue, Jun 16, 2015 at 09:28:28PM -0700, Brent Laabs wrote:
> 07:02     labster     m: multi sub prefix:<|> (\a) { a.flat }; say
> (|[1,2,3]).perl
> 07:02     camelia     rakudo-moar d6430c: OUTPUT«5===SORRY!5=== Error while
> compiling /tmp/jvrQI4RBsS␤Arg-flattening | is only valid in an argument
> list␤at /tmp/jvrQI4RBsS:1␤------> 3i sub prefix:<|> (\a) { a.flat }; say
> (|7⏏5[1,2,3]).perl␤»
> 
> Expected, one of:
>  A) single pipe works as shorthand for flat outside of arg list
>  B) Rakudo allows me to define my own flat operator (though, in this case,
> prefix:<|||> does work)
> 
> Maybe this should be notabug, but if so I'd like an explanation as to why
> neither A nor B should work.

Unary | already has a defined syntactic meaning in Perl 6 (argument 
list interpolation -- see S06 / Flattening argument lists).  

In Rakudo unary | is a syntactic construct that can't be overloaded.

So, notabug.  :)

Pm

Reply via email to