On Tue, Aug 09, 2005 at 05:08:43PM -0400, Stevan Little wrote: : Howdy, : : I wanted to make sure this question had a chance to get addressed, so I : am seperating it from the other thread which has digressed into the : depths of the metamodel (much to my delight too). : : So..., as described in the other thread, the following statements are : true about the metamodel. : : 1) MetaClass is a subclass of Object : 2) MetaClass is an instance of MetaClass : : So the following code should be true (given a random instance $obj). : : $obj.meta.isa(MetaClass); : $obj.meta.isa(Object); : : Because after all, the object returned from $obj.meta should be a : MetaClass instance right? : : However, Syn/Apoc 12 shows that the following is true if $foo is an : instance of the Foo class. : : $foo.meta.isa(Foo) : : And that $foo.isa(Foo) actually is just an alias for $foo.meta.isa(Foo).
The A12 verbiage was intended to indicate delegation rather than aliasing, so there's certainly room for calling a different method name in the meta class. : So I am sure you can see my problem here. : : The p5 prototype currently handles it as such: : : $foo->isa(Foo) # returns true if $foo is an instance of Foo : $foo->meta->isa(MetaClass) # returns true since $foo->meta returns a : MetaClass instance : $foo->meta->is_a(Foo) # returns true, note the added '_' : : Personally I am not a fan of the 'is_a' name, I just did it one day, : and it sort of stuck. Well, hey, I'm not a fan of the "isa" name, so I guess we're even. : But I do think we need to find a way to : differentiate between the two questions: : : - What class are you an instance of? : - What class are you describing? So why not just use "describes"? Then maybe Object.isa(Foo) delegates to $obj.meta.describes(Foo). : The first question can be asked of anything which inherits from Object. : The second question is really only relevant to MetaClass instances. : : Thoughts, Comments, Suggestions? My suggestion would be to assume that the Apocalypses are primarily intended to be entertaining rather than factual. :-) Larry