On Thu, May 23, 2019 at 1:27 PM Diab Jerius <djer...@cfa.harvard.edu> wrote:
> My philosophy is that the only things that should be methods are those
> that require knowledge of the private innards of a piddle, or that are
> required for implementing overloaded operators (useful for subclassing
> PDL.  I had to write overload::reify to deal with some of the PDL
> overloads).  Keep the core tight, and everything else becomes a
> function, which users have much more control over.
>

I wrote that with my C++ hat on.  And then I wrote this Perl code:

  my ( $min, $max ) = $data->signal->where( $data->index == $idx )->minmax;

and remembered how clean method chaining is.

Oh, the horror.


_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to