On Tue, Aug 09, 2005 at 10:54:54PM -0400, Stevan Little wrote: : Let me make sure I understand this. : : Package is an Object. : Module is a Package. : Class is a Package. : Role is a Package.
I think of it more like: Package is an Object. Module is a Package. Class is a Module. Role is a Class. or maybe Package is an Object. Module is a Package. Role is a Module. Class is a Role. But maybe roles don't really fit. In any event, I'd like a class to be able to also function as a module at "use" time. It's not clear that roles need to be able to do that, though I suppose if a role needs to define a macro, it has to also be a kind of module. It might be a mistake to call these isa relationships though. I really only care about Package does Object. Module does Package. Role does Module. Class does Role. If those also turn out to be "isa", fine. But it's not a requirement. In fact, one might say the essence of tagmemics is that "does" is a superset of "isa". A Noun does Verb even though a Noun isn't a Verb. : (I wont even go near subtypes as I dont completely understand them). To the type system, there is no such thing as a subtype. The type system only sees the unconstrained underlying type, except that it knows that the constrained alias implies additional constraint checks of some sort or other, so that any constrained type is considered more specific than its unconstrained counterpart. : But is Perl6::Class (the Class class) also a Package? Or is "Foo" the : Package in this picture? Foo is the name of a package, and I'm thinking now it's also the name of the undefined value of type "Foo". Perl6::Class doesn't need to be a package. It's looking to me more like an undef variant that allows certain queries to pass through to the metaclass or the package hash. : If "Foo" is the Package, then it would then be possible to implement : this system on-top of the metamodel? Foo is the name of a potentiality. It's the name of anything you can construct using the Foo package, the Foo undefined value, and the Foo metaobject (if any). : If Perl6::Class is also a package, then we have a potential bootstrap : issue. Don't care 'bout that. Perl6::Class is just the delegator, the dispatcher of dispatchers, judging everything and nothing. : >>From the viewpoint of Perl 6 The Language, a class also serves as the : >generic placeholder for reasoning about objects of the class in the : >abstract without necessarily actually having an object of that type : >to play with. As such it's the logical invocant for constructors, as : >well as other methods that want to play "what if" games on the objects : >of the class without necessarily creating one. Some of these abstract : >games will naturally call into the guts of the metaclass for answers. : >For example, you might ask the class an abstract question: "If I were : >to ask each existing object whether it thinks it's a member of your : >class, how many would say 'yes'?" Of course, the efficient way to : >answer that question is probably not to interrogate all the objects, : >but just cheat somehow via the metaobject. : : I see all these "methods of interrogation" as being class methods : defined in the base Object. Would that be correct? It might well look that way most of the time. I expect a lot of those get delegated to the metaobject, or at least the semantics are defined by the metaobject, and those semantics are merely cached by Object until someone changes the semantics. But I'm just handwaving here, hoping it will sound vaguely meaningful. If not, please ignore. : GutClass is kinda gross. I personally like the metaphors in "The Art of : MOP", which are backstage objects/classes and on-stage objects/classes. : The only thing that seperates them is the curtain, and even that can be : pulled away to expose more, but is always in control of the backstage : "crew" (aka the language implementors). Careful, we'll fall into a scripting metaphor any moment now... I guess the thing I don't like about the off-stage/on-stage metaphor is that there's no such thing as a platonic actor. Of course, an aristotelian will probably claim that platonic ideals don't exist anyway, so that's okay. Which seems like another good reason for classes to be considered fancy forms of undef... I guess a class would be kind of like the spotlight that comes up on one of the stage entrances in anticipation of an actor being instantiated there. :-) Larry