develooper Front page | perl.perl6.compiler | Postings from July 2005

Re: Is namespace qualification really required

Thread Previous | Thread Next
From:
philcrow
Date:
July 18, 2005 07:01
Subject:
Re: Is namespace qualification really required
Message ID:
200507181400.j6IE0oqL018569@webmail.sunflower.com
> Autrijus Tang <autrijus@autrijus.org> wrote:
> 
> On Fri, Jul 15, 2005 at 02:16:48PM -0500, philcrow@sunflower.com wrote:
> > package MyModule;
> >  > use v6;
> > sub doubler( Num $x ) {
> >    return 2 * $x;
> > }
> >  > sub value_v( Code +$func = &MyModule::doubler ) is export {
> >    return $func( 5 );
> > }
> >  > This works.  But I think I should be able to say:
> >  > sub value_v( Code +$func = doubler ) is export {
> 
> That won't do, as it will call the doubler.

That makes sense.
> 
> > sub value_v( Code +$func = &doubler ) is export {
> 
> This should work; if it does not, it is a bug.  Can you add a
> regression test as, say, t/subroutines/defaults.t?  I have just
> sent you a committer invitation.
> 
I made the test.  The problem only occurs when the sub is called from another package, in my case that was a driving script.

I'm not sure how to accept the invitation (or what that even means).  Sorry, I'm new here.

Phil

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About