houseabsolute / List-SomeUtils

Provide the stuff missing in List::Util
https://metacpan.org/release/List-SomeUtils/
Other
5 stars 8 forks source link

CONSIDER: Adding some more stuff : arrayify(), and co #5

Open tabulon opened 5 years ago

tabulon commented 5 years ago

Thank you @autarch, for List::AllUtils and List::SomeUtils.

Together, they keep saving my neurons :-)


At present, there appears to be a lag with List::MoreUtils.

One function that is definitely missing is arrayify(), which is the one I tend to use the most among those missing, which had a fix in version 0.425 of List::MoreUtils, after having been introduced with a bunch of other functions in 0.423 (well, 0.420_001, actually).

In fact, the bulk of the existing gap appears concern those routines added with version 0.420_001 of List::MoreUtils, dated 2017-08-15.

Apart from mode(), added via #2, the functions introduced at that point don't seem to have made it into List::SomeUtils:

0.420_001       2017-08-15
  - add some new functions:
      * qsort (XS only)
      * binsert
      * bremove
      * listcmp
      * arrayify (RT#17230)
      * samples (RT#77562)
      * minmaxstr (RT#106401)
      * lower_bound
      * upper_bound
      * equal_range
      * frequencies
      * occurrences
      * mode (RT#91991)
      * zip6 (RT#42921)
      * reduce_0
      * reduce_1
      * reduce_u

Not offering a patch since it's a matter of copy-and-paste from List::MoreUtils, but I can do that if you wish.


autarch commented 5 years ago

The author of List::MoreUtils changed the license of that distribution such that any code that he's added after version 0.417 is now under the Apache 2.0 license. My (IANAL) understanding is that this makes it trickier to include code from LMU in LSU. I would have to then include the Apache license files in this distro and try to clarify which parts of the code are under which license. All of this is a huge PITA.

AFAIK he did this specifically to make it difficult to copy the LMU code to LSU, even though I've always listed said person as one of the authors of LSU, and I made it clear that LSU was just a copy of the LMU code.

So if you or someone else wants to provide a clean room implementation (you can read the LMU docs but not the code) then I'm happy to merge a PR, as long as the implementer swears on Larry that they have not looked at the LMU code.