in reply to Re^4: Idea: Moose Mutal Coercion
in thread Idea: Moose Mutual Coercion
You think that the OP is suggesting that Moose herders use his module so that they can type this:
package Equation_Problem; use Moose; use MooseX::Invertible_Build; has mass => ( isa => Num); has velocity => ( isa => Num); has momentum => ( isa => Num, invertible_build => { A => 'mass', B => 'velocity', via => 'A * B', }, );
To 'save' typing:
package Equation_Problem; use Moose; has mass => ( isa => Num); has velocity => ( isa => Num); sub momentum { my $self = shift; $self->mass * $self->velocity; }
Hm. It can't be that in(s)ane.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Idea: Moose Mutal Coercion
by choroba (Cardinal) on Feb 15, 2012 at 16:27 UTC | |
by BrowserUk (Patriarch) on Feb 15, 2012 at 16:54 UTC |