On Mon, 2005-07-11 at 17:47 -0400, Stevan Little wrote: > I actually agree with you on that. But I would like to clarify it to > say that: > > Foo.isa(Bar) # Foo.meta.isa(Bar) || Foo.meta.does(Bar) > > ... meaning that the .isa() which is supposed to be aliased into the > class from .meta is actually this.
I've always thought that .does() should check .isa() as well. That's how Class::Roles works in Perl 5. If you *really* need to know that Bar inherits from Foo, there's .isa(). If all you really care about is that Bar is Liskov-a-rific with respect to Foo, use .does(), which checks that Bar inherits from or does the role of Foo, whether it mixes in any methods or not. Have I mentioned before that I think you should be able to say: class Foo { method foo { ... } method more_foo { ... } } class Bar does Foo { method foo { ... } } ... probably get a compile-time error that Bar doesn't support more_foo()? > I see a reason to differentiate between roles and classes on the > metalevel, but the argument is not as strong on the user-level. I go further to see little reason to distinguish between role, class, and type names (and what reason there is is for introspective capabilities, not standard user-level type checking). -- c