in reply to Re^2: On the rejected additions to List::Util
in thread On the rejected additions to List::Util

The arithmetic mean, geometric mean, mode, median, etc of a group of numbers are not properties of a generic list of scalars. There is no meaningful arithmetic mean of qw( Porculus mr_mischief metaperl ikegami ) for example. Those are statistical properties, and I believe rightly belong in the Statistics name space rather than the List name space.

Replies are listed 'Best First'.
Re^4: On the rejected additions to List::Util
by ysth (Canon) on Apr 29, 2009 at 06:32 UTC

      minstr and maxstr are well defined for qw( Porculus mr_mischief metaperl ikegami ). meanstr is not. (The median though could be defined for odd-sized lists of strings.)

      The thing is that Perl has different comparison/ordering operators. So there are two natural ways to define min and max in Perl corresponding to the two sets of ordering operators. Had there been only one version of "greater than" then I figure there would have been only one function for min resp. max.


      Well, for sake of absolute purity the minimums and maximums might be better placed in the Statistics modules, too. It's a little late to make that decision pragmatically, since L::U is standard and already includes them.

      Where to draw the line on what to include and what not to include can be a difficult one. Second-guessing the maintainer about what they are willing to maintain and not maintain according to their vision for the module doesn't seem very productive. If someone has a clear and sensible argument for additional functionality, then I'm sure it would be considered along with other factors.

      It would take quite an argument, I think, to argue adding functionality to a core Perl module that already exists in multiple CPAN modules. One would have to convince the maintainer that the additional code is ultimately useful. It would have to meet a common need. It can't spread development and testing time too thin. It can't bloat the core distribution too much. Any additional functionality has to fit with the theme of the module as understood by the maintainer. Ideally, someone wanting additional functionality would present a well-suited patch in the style of the existing code along with an argument covering each of these points.

      There's still not a guarantee what the maintainer of a module will agree to do. After all, that person or team has to maintain those changes even if they accept the patch. It would go much farther than just saying essentially "I can foresee other operations on lists, and all of them should be in a module called List::Utils".

        Anything added to "core" is bloat by definition; sometimes it's just a minor bump, other times addition is a cancerous tumour. I do like the qualified phrase "not bloat too much".   ;-)