Several people have threatened to write a custom attribute metaclass
to do this, but none have done it (at least none to my knowledge).
I think the problem is that it gets ugly cause it ends up touching the
method code generation stuff, which is pretty bad. But it is possible
to do (might require a little refactoring of some Moose guts, but very
possible).
- Stevan
On Feb 11, 2009, at 7:53 PM, Terrence Brannon wrote:
I would like to be able to do this with a Moose object:
package Doc;
use Mouse;
has 'body' => (is => 'rw');
has 'hdr' => (is => 'rw');
has 'ftr' => (is => 'rw');
1;
my $m = Doc->new;
$m->body(12)->hdr->(14)->ftr(5);
Is this possible?