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

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

Thread Previous | Thread Next
From:
Hildo Biersma
Date:
September 13, 2000 00:38
Subject:
Re: Draft RFC: new pragma: C<use namespace>
Message ID:
39BF2E32.3D96DD2E@msdw.com
Piers Cawley wrote:
> =head1 ABSTRACT
> 
> C<my Big::Long::Prefix::Class $object = Big::Long::Prefix::Class-E<gt>new>
> is a pain in the bum to type. We should replace this with
> 
>     use namespace 'Big::Long::Prefix';
>     my ::Class $object = ::Class->new;

This is a bit dangerous, since we can get into ambiguities again.
If I have A::B::C::Foo,  A::B::C::Bar, X::Y::Z::Foo and X::Y::Z::Bar,
I'd like to use shorthands for A::B::C's Foo and X::Y::Z's Bar at the
same time.

While we don't want to go the whole C++ namespace route, I'd like to be
able to import 'all' of a namespace, or just selected classes from a
namespace.

Hildo

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