Will it ever end?

ethan on 2004-11-28T06:54:44

For over a week now I am preparing the next List::MoreUtils release. It takes so long because I am incorporating all stuff from List::MoreUtil into it. For each new function I had to write an equivalent XSUB and some of the turned out to be a bit tricky.

Then I noticed that List::MoreUtil's tests (that I simply took over) are incomplete in that they don't test some of the key characteristis of each function. Some map-like functions pass aliases to the original values to their code argument. Others don't. As it happened, I also noticed that the pure-Perl implementation and the XSUB one sometimes differed with respect to this so I had to make that consistent, too.

The only thing left is now copying the documentation for these functions over from List::MoreUtil. Most probably I will be deeply unhappy with it so I might end up rewriting it.


how about adding...

Limbic Region on 2004-11-28T17:27:21

avg() for getting the average over a list

uniq() for returning unique values from a list

uniq_ordered() for returning unique values from a list in the order that they were first seen

stats() which will return max, min, ave, tot, count for a list

See http://www.perlmonks.org/?node_id=407834 for background.

Cheers
L~R

Re:how about adding...

ethan on 2004-11-28T20:12:42

avg is already getting dangerously close to statistical functionality. Not that this would be fundemantally wrong in a list-module, but then people might come and ask for functions to calculate the quadratic mean or geometric mean as well.

As for uniq and uniq_ordered, the first is no more computational work than the second from an XS point of view (as there are no hash-slices in C so one needs to loop anyway). uniq I could add.

I am not convinced that stats is so terribly useful. max and min are already in List::Util and tot is really List::Util::sum.

See http://www.perlmonks.org/?node_id=407834 for background.

I'd have to think about the idea of function generators as exemplified in the above. That way they can be used in an incremental fashion...but it also makes them more complex (a lot more complex in XS).