Moritz (>), Carl (>>): >> But on another level, the level of types, Perl 6 makes it fairly >> *un*natural that the type C<Foo> refers to the type C<Bar>, which in >> turn refers to the type C<Foo>. > > True, and that has also been bothering me quite a bit. > > The "solution" is to always write ::Typename instead of Typename.... > except when it isn't a solution. > > First of all in signatures ::T means actually "type capture", secondly I > guess that some constructs really want to resolve type names at compile > time -- for example the multi dispatcher needs to know the inheritance > structure of a type in order to its pre-sorting of signatures. > > The first problem could be solved by introducing another syntax for type > captures (perhaps :>foo or so?), of the second I know too little to > really comment on it.
I had half an idea about the second one as I wrote the first mail. It may or may not be useful, but here goes: Some keyword, on the level of 'is' and 'does', which allows one to use a not-yet-defined typename within another type. It wouldn't solve the core problem -- the one about having to think about circularities -- but it would allow one to create cycles. So this would work: class A precedes-but-refers-to B { ... B ... } class B { ... A ... } Just an idea. // Carl