3 ms·
Perl 6 does, with a "handles" trait: class MyType { has SomeOtherType $.containedObject handles ('MethodA', MethodB => 'SomeOtherName', 'MethodC');
by perlgeek 7y ago
Perl 6 does, with a "handles" trait:
class MyType {
has SomeOtherType $.containedObject handles ('MethodA', MethodB => 'SomeOtherName', 'MethodC');
}
Very useful when you need it.
https://docs.perl6.org/language/typesystem#trait_handles https://docs.perl6.org/language/typesystem#trait_handles
- fanf2 7y agoSimilar in perl5 with Moose or Moo package MyClass; use Moo; has member => ( is => ‘rw’, handles => [qw[ methodA methodB ]] );