Trey Harris wrote:

> An alias?  Isn't
> 
>   class Date is Really::Long::Package::Name::Ugh;
> 
> a new class declaration, declaring 'Date' as a subclass of
> Really::Long::Package::Name::Ugh? 

Yes. It's not an alias.


> it will have a similar effect to aliasing Really::Long::Package::Name::Ugh
> under the name 'Date', simply because the subclass hasn't redefined any
> behavior of the parent.

Yes.


> But it *is* a separate class 

Yes.


> unless Damian was saying that there would be some special casing when a class
> declaration contains no body.

No, I never said (nor intended to imply) that. Note that I carefully avoided the
word "alias" in my description of this technique. ;-)


> Furthermore, we haven't seen any final word about export behavior, but the
> default is something along the lines of 'public', correct?  So if you have
> a module or class file containing the above declaration, the class 'Date'
> should be exported to users of the module, unless you write it
> 
>   my class Date is Really::Long::Package::Name::Ugh;
> 
> right?

Classes aren't actually exported. But yes, the classname Date would be universally
visible, unless you made it lexical (as in your last example above).

Damian


Reply via email to