On Sat, 30 Jul 2011 14:19:40 -0700, masak wrote: > <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.