Re: what am I doing wrong here?

2017-09-14 Thread Todd Chester




On 09/14/2017 09:10 AM, Timo Paulssen wrote:

You're reaching deep into rakudo's internals here, reaching an object
that doesn't know about pretty much any methods you might want to have,
and there's also no support for them in things like the ~~ operator, for
example.

You're getting the error because you're calling ~~ with the NQPRoutine
object, but there's no candidate in the multi sub :<~~>, which is
why you're getting an X::Multi::NoMatch. I assume the method that tries
to build the proper message is trying to look closely at the NQPRoutine
object that got passed and accidentally causes an X::Method::NotFound,
and that's why you get the much less helpful error message "Died with
X::Multi::NoMatch".

Clearly the example from the docs ought to be changed to handle this, too.

Hope that helps!
   - Timo



Hi Timo,

Well, it means it is not me for once!

Thank you for the help!

-T


Re: what am I doing wrong here?

2017-09-14 Thread Timo Paulssen
You're reaching deep into rakudo's internals here, reaching an object
that doesn't know about pretty much any methods you might want to have,
and there's also no support for them in things like the ~~ operator, for
example.

You're getting the error because you're calling ~~ with the NQPRoutine
object, but there's no candidate in the multi sub :<~~>, which is
why you're getting an X::Multi::NoMatch. I assume the method that tries
to build the proper message is trying to look closely at the NQPRoutine
object that got passed and accidentally causes an X::Method::NotFound,
and that's why you get the much less helpful error message "Died with
X::Multi::NoMatch".

Clearly the example from the docs ought to be changed to handle this, too.

Hope that helps!
  - Timo


what am I doing wrong here?

2017-09-13 Thread ToddAndMargo


#!/usr/bin/env perl6

# Reference: https://docs.perl6.org/type/CallFrame

for 1..* -> $level {
given callframe($level) -> $frame {
when $frame ~~ CallFrame {
next unless $frame.code ~~ Routine;
say $frame.code.package;
last;
}
default {
say "no calling routine or method found";
last;
}
}
}



$ CallFrameTest.pl6
Died with X::Multi::NoMatch
  in block  at ./CallFrameTest.pl6 line 8
  in block  at ./CallFrameTest.pl6 line 5


Who called X::Multi::NoMatch?  And zef has no record of it.

I pulled this out of the example  on

https://docs.perl6.org/type/CallFrame


Many thanks,
-T