I've released MooX::PDL::Role::Proxy to CPAN [1]

What is it? It's a Moo role which attaches piddle like properties and
behaviors to objects containing piddles.

In other words, if your Moo class contains piddles,

  package Events;
  use Types::PDL -types;

  has [ 'x', 'y', 'z' ] => ( is => 'ro', isa => Piddle1D );


and you want to run where() on all of them at the same time, rather
than doing something like this:

  $x = $obj->x->where( $mask );
  $y = $obj->y->where( $mask );
  $z = $obj->z->where( $mask );
  my $new = Events->new( x => $x, y => $y, z => $z );

you can just do this:

  $new = $obj->where( $mask );

(After some tweaking of the Events class.  This is magic, not sorcery.)

It's early days for this, so things will evolve.

[1] https://metacpan.org/pod/MooX::PDL::Role::Proxy


_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to