On Sun, Jan 31, 2010 at 06:35:14PM +0100, Carl Mäsak wrote:
> I found two ways. Either one uses C<augment> (the language construct
> formerly known as C<is also>):
> 
>   class B {}
>   class A { sub foo { B::bar } }
>   augment class B { sub bar { A::foo } }
> 
> ...or one may use the C<::> notation to index a type using a string value:
> 
>   class A { sub foo { ::<&B::bar>() } }
>   class B { sub bar { A::foo } }

There's a third way:

    class B { ... }    # introduce B as a class name without definition
    class A { sub foo { B::bar } }

    class B { sub bar { A::foo } }

The first line is a literal "..." in the body of the class -- it
indicates that we're only declaring the name as being a type,
and that something else will fill in the details later.

Pm

Reply via email to