Jon Lang dataweaver-at-gmail.com |Perl 6| wrote:
I'm having some difficulty understanding the business with £. I
_think_ that you're saying that £ sort of acts as a prefix operator
that changes the meaning of the type with which it is associated; and
the only time that a change in meaning occurs is if the type in
question makes use of ::?CLASS or a generic parameter.
Not only generic parameters, but overridden virtual type names too. In
general, type names can be changed by derived classes just like methods.
You say that in Perl 6, a role normally treats ::?CLASS as referring
to the role.
No, ::?CLASS refers to the actual class. Maybe you're confused because
a footnote said to pretend it stood for the role when using the role
itself as a type, because it does not exist at all.
As for classes and roles that have generic parameters: here, you've
completely lost me. How does your proposed '£' affect such classes
and roles?
The pointlike[::T] role has a generic parameter.
The concrete class Point3D[Rat] matches "pointlike", and it figures out
that to make the match work that T has to be Rat.
It figures out that FoxPoint is pointlike, if it uses Num for T.