Re: RFC 335 (v1) Class Methods Introspection: what methods does this object support?
[email protected] (Piers Cawley) 29 Sep 2000 08:52:21 +0100
| Newsgroups | perl.perl6.language.objects |
|---|---|
| Message-ID | <[email protected]> |
Perl6 RFC Librarian <[email protected]> writes: > This and other RFCs are available on the web at > http://dev.perl.org/rfc/ > > =head1 TITLE > > Class Methods Introspection: what methods does this object support? > > =head1 VERSION > > Maintainer: Mark Summerfield <[email protected]> > Date: 28 Sep 2000 > Mailing List: [email protected] > Number: 335 > Version: 1 > Status: Developing > > =head1 ABSTRACT > > This RFC proposes a new UNIVERSAL method which would be used thus: > > my @method_names = $object->methods(); # OR MyClass->methods(); Nice work. However, I would say that in an OO context there's a case for walking the @ISA Tree to find out all the methods that the class will respond to, say $object->all_methods, after all, in a complex class hierarchy there may be classes that implement only one or two methods that are distinct from the methods of their parent class. Actually, I'd like to see something similar done to Universal::can (though Interface polymorphism may make this less important...) -- Piers