Let's say I use a certain set of boilerplate fairly regularly:
class Foo {
method abc($a: $b, $c, +@d) is pure {
use Slang::Bar;
…
}
method xyz($a: $b, $c, +@d) is pure {
use Slang::Bar;
…
}
method blarg($a: $b, $c, +@d) is pure {
use Slang::Bar;
…
}
}
I'd rather be able to just say:
class Foo is/does Bar {
bar abc { … }
bar xyz { … }
bar blarg { … }
}
And somewhere in Bar, set up the declaration for bar (or, since class Foo will itself ultimately use its own declarator, it could go somewhere else and doesn't have to be pulled out in a separate Type). How would I go about doing that?