Ian,

It looks good to me, although not sure if it needs to be a MooseX:: module as it is nothing truly Moose specific about it.

Also, in the spirit of TIMTOWTDI, you can do the following

   package My::Algorithm::Param::Set1;
   use My::Moose;
   extends 'My::Algorithm::Param';
   sub BUILDARGS { { foo => 4 } }

   package My::Algorithm::Param::Set2;
   use My::Moose;
   extends 'My::Algorithm::Param';
   sub BUILDARGS { { foo => 10, bar => 4 } }

   package My::Algorithm::Param::Set1;
   use My::Moose;
   extends 'My::Algorithm::Param';
   has '+foo' => (default => 4);

   package My::Algorithm::Param::Set2;
   use My::Moose;
   extends 'My::Algorithm::Param';
   has '+foo' => (default => 10);
   has '+bar' => (default => 4);

Which is more Moose-ish as it keeps the default values in the meta- attributes instead of hidden inside the BUILDARGs.

- Stevan

Reply via email to