Re: Who called me?

2017-09-15 Thread ToddAndMargo
On 09/13/2017 04:56 PM, ToddAndMargo wrote: Hi All, I am trying to convert this from Perl 5: my $WhoCalledMe = ( caller(0) )[1]; I use it inside a sub to determine who called the sub. How is this done in P6? Many thanks, -T Follow up: With a lot of help from the chat line, it

Re: Who called me?

2017-09-13 Thread Brandon Allbery
On Wed, Sep 13, 2017 at 8:15 PM, ToddAndMargo wrote: > Would this be what I am looking for? > > > for 1..* -> $level { > given callframe($level) -> $frame { > when $frame ~~ CallFrame { > next unless $frame.code ~~ Routine; > say

Re: Who called me?

2017-09-13 Thread ToddAndMargo
On 09/13/2017 05:15 PM, ToddAndMargo wrote: On 09/13/2017 05:01 PM, Brandon Allbery wrote: On Wed, Sep 13, 2017 at 7:56 PM, ToddAndMargo > wrote: I am trying to convert this from Perl 5: my $WhoCalledMe = ( caller(0) )[1];

Re: Who called me?

2017-09-13 Thread Brandon Allbery
On Wed, Sep 13, 2017 at 7:56 PM, ToddAndMargo wrote: > I am trying to convert this from Perl 5: > > my $WhoCalledMe = ( caller(0) )[1]; > > I use it inside a sub to determine who called the sub. > > How is this done in P6? > You want the callframe method. Note that it