Larry Wall |Perl 6| wrote:

If a role is derived from a class,
According to S12:
"A role may not inherit from a class..."

 it must of necessity be a snapshot
of the class, because roles are immutable, while classes are not.
The only interesting question in my mind is whether you can take
another snapshot and override the previous one somehow, or whether
such derived roles should version themselves so that the snapshots
can be distinguished by longname.  Alternately, we make one snapshot
when a class is first composed, and refuse to make any other snapshots
for that name regardless of how the class under that name changes.


But, the way I see it, the "item" listed in the role that says

    is Base;

is declaring it from the point of view of the eventual class that composites the role. It will be processed when a class is defined by playing back the metaobject instructions to create a class, just like you had said "is Base" in that class's block at THAT TIME.

The definition of the role simply files away "is Base" for later, and doesn't look to see what's in Base now for purposes of seeing which symbols are already available.

No need for keeping track of snapshots.

How's that?


Reply via email to