Re: RFC 193 (v1) Objects : Core support for method delegation
[email protected] (Damian Conway) Wed, 6 Sep 2000 06:43:44 +1100 (EST)
| Newsgroups | perl.perl6.language.objects |
|---|---|
| Message-ID | <[email protected]> |
> Is this not just a module which creates the necessary subs in the calling > package ? The catchall can be done with an AUTOLOAD sub. That's certainly how Class::Delegation is implemented. It isn't quite adequate however, because if you trigger the AUTOLOAD and it *fails* to delegate, you can only invoke $self->SUPER::AUTOLOAD(), which locks out any potential AUTOLOADS on *other* branches of the inheritance tree. Of course, the NEXT:: pseudoclass would fix that limitation too. The reason I proposed it for the core is simple: speed. No-one will use delegation unless it's fast, and it won't be fast unless it's integrated with the dispatch mechanism. Damian