Skip Menu |
Report information
Id: 95970
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Code.callwith introduces an official CALLER frame in Rakudo
Date: Sat, 30 Jul 2011 23:19:15 +0200
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 1.2k
<masak> is there a method for invoking a Routine? besides postcircumfix:<( )>, I mean? <jnthn> rakudo: sub foo($a) { say $a }; &foo.callwith(42) <p6eval> rakudo 922500: OUTPUT«42␤» <jnthn> That's what I thought when I saw .callwith :) <masak> oh, interesting, .callwith without being in a call already :) <moritz> why do you need anything besides .() ? <masak> moritz: I don't, I'm just thinking ahead :) <jnthn> Code.callwith(...) has no relation to callwith(...) <masak> oh! <masak> that's... unfortunate... <jnthn> I dunno if the first is even tested, fwiw. <jnthn> I guess if we have it it's spec <jnthn> But it seems kinda...well...pointless. <masak> hm, yes. S06:1146 mentions something of the sort. <masak> "Use of C<callwith> allows the routine to be called without introducing an official C<CALLER> frame." <masak> that seems to be why. <masak> should've been named .gotowith :P <jnthn> oh <jnthn> well, we don't do that. :) * masak submits rakudobug * jnthn doesn't bother re-adding it to nom :) <moritz> masak: use callframe() to prove it :-) <masak> rakudo: sub foo { my $foo; &bar.callwith() }; sub bar { my $bar; say callframe.my }; foo <p6eval> rakudo 922500: OUTPUT«$bar [...] <masak> that's good enough. * masak adds that to the ticket
Download (untitled) / with headers
text/plain 1.5k
On Sat, 30 Jul 2011 14:19:40 -0700, masak wrote: Show quoted text
> <masak> is there a method for invoking a Routine? besides > postcircumfix:<( )>, I mean? > <jnthn> rakudo: sub foo($a) { say $a }; &foo.callwith(42) > <p6eval> rakudo 922500: OUTPUT«42␤» > <jnthn> That's what I thought when I saw .callwith :) > <masak> oh, interesting, .callwith without being in a call already :) > <moritz> why do you need anything besides .() ? > <masak> moritz: I don't, I'm just thinking ahead :) > <jnthn> Code.callwith(...) has no relation to callwith(...) > <masak> oh! > <masak> that's... unfortunate... > <jnthn> I dunno if the first is even tested, fwiw. > <jnthn> I guess if we have it it's spec > <jnthn> But it seems kinda...well...pointless. > <masak> hm, yes. S06:1146 mentions something of the sort. > <masak> "Use of C<callwith> allows the routine to be called without > introducing an official C<CALLER> frame." > <masak> that seems to be why. > <masak> should've been named .gotowith :P > <jnthn> oh > <jnthn> well, we don't do that. :) > * masak submits rakudobug > * jnthn doesn't bother re-adding it to nom :) > <moritz> masak: use callframe() to prove it :-) > <masak> rakudo: sub foo { my $foo; &bar.callwith() }; sub bar { my > $bar; say callframe.my }; foo > <p6eval> rakudo 922500: OUTPUT«$bar [...] > <masak> that's good enough. > * masak adds that to the ticket
It now fails with: No such method 'callwith' for invocant of type 'Sub' Looks like the method forms of `callwith` & friends that S06 proposed, didn't make it into Perl 6.c Marking the ticket NYI.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org