3 ms·
Perl 6 makes calling sets of methods[0] easy as well: role Foo { multi method go { 1 } } role Bar { multi method go { 2 } } my $t = (class :: { }).
by ugexe 10y ago
Perl 6 makes calling sets of methods[0] easy as well:
role Foo { multi method go { 1 } }
role Bar { multi method go { 2 } }
my $t = (class :: { }).new;
$t does Foo;
say $t.*go; # (1)
$t does Bar;
say $t.*go; # (2, 1)
[0]: https://design.perl6.org/S12.html#Calling_sets_of_methods https://design.perl6.org/S12.html#Calling_sets_of_methods