On Nov 5, 2008, at 9:41 PM, Patrick R. Michaud wrote:

On Tue, Nov 04, 2008 at 09:10:02PM -0600, Chris Dolan wrote:
The Perl6 code that triggers that looks like this:

   method is_string(Str $src, Str $expected, Str $msg) {
      my $method = PDF::Grammar::literal_string;

... just a point of syntax (which probably doesn't resolve the
issue you're having), but "PDF::Grammar::literal_string" above
gets treated like a listop call instead of a method reference.
To get the method itself, we probably need an ampersand in front.

I'm still looking into the other details of the problem you're having.

Pm

Actually, I just submitted a one-line patch to the Rakudo actions.pm via RT 60358 that solves this problem. I got a big boost from the namespace fix Jonathan did this week.

It sure behaves like a method reference... Anyway, I didn't actually *want* the method. Rakudo wouldn't let me do the perl5ish external- package-method-call syntax like this:

      my $m = $src.PDF::Grammar::literal_string(...);

so I had to break it up into two statements

      my $method = PDF::Grammar::literal_string;
      my $m = $src.$method(...);

which works. I can't explain why I didn't need the ampersand. Lucky, I guess. It'll probably break when someone fixes that bug. :-)

Chris

Reply via email to