On Thu Jan 08 06:11:21 2009, richardh wrote:
> I have the following in a file test.pl
>
> macro doit ($word) {
> return quasi <say <<<$word>>> <<<$word>>> ;>
> };
>
> doit('one');
> doit('two');
> doit('three');
>
>
> It should - I think - be outputting:
> one one
> two two
> three three
>
> Instead I get:
> $ perl6 ./test.pl
> Statement not terminated properly at line 1, near "{\n return"
>
> current instr.: 'parrot;PGE;Util;die' pc 129
> (runtime/parrot/library/PGE/Util.pir:83)
> called from Sub 'parrot;Perl6;Grammar;eat_terminator' pc 28962
> (src/gen_grammar.pir:3368)
> called from Sub 'parrot;Perl6;Grammar;statementlist' pc 27610
> (src/gen_grammar.pir:2835)
> called from Sub 'parrot;Perl6;Grammar;statement_block' pc 25043
> (src/gen_grammar.pir:1841)
> called from Sub 'parrot;Perl6;Grammar;TOP' pc 20899
> (src/gen_grammar.pir:210)
> called from Sub 'parrot;PCT;HLLCompiler;parse' pc 634
> (src/PCT/HLLCompiler.pir:388)
> called from Sub 'parrot;PCT;HLLCompiler;compile' pc 428
> (src/PCT/HLLCompiler.pir:301)
> called from Sub 'parrot;PCT;HLLCompiler;eval' pc 862
> (src/PCT/HLLCompiler.pir:500)
> called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1217
> (src/PCT/HLLCompiler.pir:669)
> called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1398
> (src/PCT/HLLCompiler.pir:759)
> called from Sub 'parrot;Perl6;Compiler;main' pc 19195 (perl6.pir:162)
>
>
Here's a version updated to current macro syntax:
21:05 < [Coke]> r: macro doit ($word) { return quasi { say {{{$word}}},
{{{$word}}} ;} }; doit('one'); doit('two'); doit('three');
21:05 <+p6eval> rakudo fc349a: OUTPUT«oneonetwotwothreethree»
Basic macros are pretty well tested. Closing ticket.
--
Will "Coke" Coleda