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

Re: Is namespace qualification really required

Thread Previous | Thread Next
From:
Autrijus Tang
Date:
July 15, 2005 21:00
Subject:
Re: Is namespace qualification really required
Message ID:
20050716040111.GB44906@aut.dyndns.org
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.

> 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.

Thanks!
/Autrijus/


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