ingydotnet/mo-pm

allow chaining

Closed this issue · 2 comments

accessor chaining would be very useful:

package Hello;
use Mo;
has 'first';
has 'second';

my $hello = Hello->new;
$hello->first('foo')->second('bar');
print $hello->first;
print $hello->second;

This seems non-Moose and out of scope. You can always:

my $hello = Hello->new(
first => 'foo',
second => 'bar',
);

I actually like to chain, but it's not for Mo. At least not for now.

Neither Moo nor Moose nor Mouse does this by default, and nor do the vast majority of pre-Moose accessor builders.

Closing.