develooper Front page | perl.perl6.language.objects | Postings from September 2000

Re: Draft RFC: new pragma: C<use namespace>

Thread Previous | Thread Next
From:
Nathan Wiger
Date:
September 13, 2000 19:05
Subject:
Re: Draft RFC: new pragma: C<use namespace>
Message ID:
39C0306D.C0FF18D1@wiger.org
>     use namespace 'Big::Long::Prefix';
>     my ::Class $object = ::Class->new;

Anyone mentioned that this:

   $SHORT = 'Some::Huge::Obnoxious::Ridiculous::Term';
   $SHORT->member;
   $stuff = new $SHORT;

Already works? The only problem is that this:

   $SHORT::stuff(@args);

Doesn't, but this is a precedence issue with :: and variable
interpolation which I actually submitted RFC 103 on. You could still
write this currently:

   &{"${SHORT}::stuff"}(@args);

But admittedly this is not pretty to look at.

Assuming repairing :: precedence is a reality I don't think this
proposal buys us anything. I had actually seen the p5p thread before,
and it seems like a neat idea on the surface, but it's a real special
case and syntax for something that can be solved with simple variables.

-Nate

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