On Mon, Aug 15, 2005 at 08:19:38AM -0700, Larry Wall wrote:
> I think the distinction is still useful to document that there are
> still unbound types. What we need to emphasize is that a role can be
> used as a class, at which point any unbound types are bound to Any,
> or whatever we're calling it these days. I'd say Array is a role,
> not a class. So these all might do different things:
>
> class LoudArray is Array { ... }
> role LoudArray does Array { ... }
> role LoudArray is Array { ... }
So the last line means a role can be used just like a class, and
_inherit_ its behaviour as well?
role Point { has $.x; has $.y; method move_right { $.x++ } };
role MyPoint is Point {
method move_right { ./SUPER::move_right(); $.y++; }
}
Thanks,
/Autrijus/
pgpXgDRhRriNM.pgp
Description: PGP signature
