On Fri, May 02, 2008 at 12:21:27PM -0700, chromatic wrote:
> On Friday 02 May 2008 11:55:54 Larry Wall wrote:
> 
> > On Fri, May 02, 2008 at 11:15:34AM -0700, chromatic wrote:
> 
> > : All classes imply the existence of a role of the same name.
> 
> > If a role is derived from a class, it must of necessity be a snapshot
> > of the class, because roles are immutable, while classes are not.
> 
> Agreed.
> 
> > 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.
> 
> I'm not sure which is best.  Snapshotting at the time of first composition 
> (or 
> the first time someone says "Hey, I provide that other class's role!") seems 
> right though.

I don't think that first composition is useful. If it's first composition,
then if my code loads up a class, with the intention of extending it, then
wants to pass it somewhere else that uses it as a role, then it fails.
I'd have to declare an empty subclass of the (now modified) class, just to
be allowed to make a role. And I think that this applies:


On Fri, May 02, 2008 at 04:32:00PM -0700, chromatic wrote:

> 2b) If the only way to declare that conformance is through subclassing, you 
> lose and I'll take your language designer license away*.

> * Note that there is no language designer license.  Yet.


Although if, instead, it's first time that some code references that class as
a role, I'm still a bit stuffed if the package that defines the class also
manages to do something that references it as a role, and does it all before
the BEGIN block of the use returns, and my code isn't able to add its
modifications.

Is there any way to pre-declare that I want to defer baking the role from a
class? (Which I guess would make it an error to reference that role at run
time in any way, until I'd issued a second declaration that I was done, and
baking season is open)

Nicholas Clark

Reply via email to