No, both programs are wrong, not correct. The bug is that Rakudo
accepts the first one, not that it rejects the second one. The error
message to the second one looks correct to me. (It tries to hash-index
the list of stuff the .map generated.)

<masak> r: .say for (1, 2, 3) <<~>> "!"; .say for (1, 2, 3) «~» "!";
.say for (1, 2, 3)«~»"!"
<p6eval> rakudo 87ad7c: OUTPUT«1!␤2!␤3!␤1!␤2!␤3!␤1!␤2!␤3!␤»
<masak> r: .say for (1, 2, 3)<<~>>"!"
<p6eval> rakudo 87ad7c: OUTPUT«===SORRY!===␤Two terms in a row␤at
/tmp/Kg__QjZ4yV:1␤------> .say for (1, 2, 3)<<~>>⏏"!"␤ [...]
* masak submits rakudobug
<jnthn> masak: It parsed as a subscript
<masak> jnthn: I know.
<jnthn> masak: Yes, and STD does it too.
<jnthn> masak: It's not a bug.
<masak> jnthn: responding to Ovid's p6u email from a week ago.
<masak> jnthn: the fact that it parses as a subscript isn't the bug.
<masak> jnthn: look at the evaluation before.
<masak> it parses as a subscript when it's <<~>>, but not when it's «~»
<jnthn> oh...
<jnthn> Yeah, that's 'cus we're missing those quotes in the grammar somehow
<masak> that's the bug.
<jnthn> masak: OK, fair enough.

// masak

On Mon, Feb 25, 2013 at 11:56 AM, Ovid <curtis_ovid_...@yahoo.com> wrote:
> I was playing with this code: 
> https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.pl6
>
>     [~](((1..100).map: {
>         $_ % 15 == 0 ?? "FizzBuzz" !!
>         $_ %  3 == 0 ?? "Fizz" !!
>         $_ %  5 == 0 ?? "Buzz" !!
>         $_
>     })«~»("\n")).print;
>
> I was cleaning it up and since not everyone can type guillemets, I wound up 
> with this:
>
>     [~](((1..100).map: {
>         $_ %% 15 ?? "FizzBuzz" !!
>         $_ %%  3 ?? "Fizz"     !!
>         $_ %%  5 ?? "Buzz"     !!
>         $_
>     })<<~>>("\n")).print;
>
> That generated this error:
>
>     No such method 'postcircumfix:<( )>' for invocant of type 'Parcel'
>       in  at src/gen/BOOTSTRAP.pm:852
>       in any  at src/gen/BOOTSTRAP.pm:836
>       in block  at fizzbuzz.p6:6
>
> Reverting to guillemets fixes the problem. Is this a Rakudo bug or are double 
> angle brackets not interchangeable with guillemets?
>
>
>     bin/perl6 -v
>     This is perl6 version 2013.01 built on parrot 4.10.0 revision 0
>
> Cheers,
> Ovid
> --
> Twitter - http://twitter.com/OvidPerl/
> Buy my book - http://bit.ly/beginning_perl
> Buy my other book - http://www.oreilly.com/catalog/perlhks/
> Live and work overseas - http://www.overseas-exile.com/

Reply via email to