Patrick (>), Carl (>>):
>> 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.

That's nice. Seems like a decent way to avoid 'use MONKEY_TYPING'.

Is it allowed to do 'class B { ... }' several times in different files
before finally declaring the real B? If so, then I'd consider it
equivalent to my proposed keyword, and thus there'd be no need for the
latter.

// Carl

Reply via email to