Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code.callwith #2456

Open
p6rt opened this issue Jul 30, 2011 · 3 comments
Open

Code.callwith #2456

p6rt opened this issue Jul 30, 2011 · 3 comments
Labels
NYI

Comments

@p6rt
Copy link

@p6rt p6rt commented Jul 30, 2011

Migrated from rt.perl.org#95970 (status was 'open')

Searchable as RT95970$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 30, 2011

From @masak

<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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Sep 10, 2017

From @smls

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Sep 10, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the NYI label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.