Skip Menu |

This queue is for tickets about the List-MoreUtils CPAN distribution.

Report information
The Basics
Id: 123767
Status: resolved
Priority: 0/
Queue: List-MoreUtils

People
Owner: Nobody in particular
Requestors: PETDANCE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Document the difference between List::Util::first and List::MoreUtils::firstval
From all I can tell in the docs, List::Util::first and List::MoreUtils::firstval are functionally equivalent. Is that true? If that's the case, please explain that in the documentation. If it's not true, please explain the difference between the two functions. As it stands now, I don't know which one to use if it makes a difference?
As List::MoreUtils is designed and defined as a module, providing the stuff missing in List::Util, I'd say - please ask List::Util to define which function they took from List::MoreUtils and how compatible they are. If you are in a situation where you have to decide which implementation is the best for a particular project, I'd suggest following decision path: 1) do you use other functions from one of both modules - then stay and do not grow your dependencies 2) do you use none of both modules, pick the easier available one (mind: List::Util is in core since 5.7.3) 3) still there? use List::MoreUtils;
I'm sorry if I opened a political can of worms here. All I'm asking for an explanation in the docs explaining the differences, if any, between List::Util::first and List::MoreUtils::firstval. I have a codebase that uses List::Util::first in some places and List::MoreUtils::firstval. I'd like to standardize on one or the other. I'm just looking for clarification in the docs that they work the same, or how they're different if not. I'm sure I can't be the only one in this situation.
On Wed Dec 13 10:04:51 2017, PETDANCE wrote: Show quoted text
> I'm sorry if I opened a political can of worms here.
As far as I can say: you didn't open a political can of worms :) Unfortunately there is neither noteworthy communication between List::Util and List::MoreUtils nor between PEVANS and myself. Show quoted text
> All I'm asking for an explanation in the docs explaining the > differences, if any, between List::Util::first and > List::MoreUtils::firstval. I have a codebase that uses > List::Util::first in some places and List::MoreUtils::firstval. I'd > like to standardize on one or the other. I'm just looking for > clarification in the docs that they work the same, or how they're > different if not. I'm sure I can't be the only one in this situation.
You're the one and only who asked. Finally I can't do more than you and have a look into List::Util documentation and from there I'd say, they're the same. I see that first() is mentioned around 2001 for release 1.03 first time in List:Util and can imagine that Tassilo introduced it to complete the quadruple of firstidx/firstval/lastidx/lastval - but finally no one knows and I don't know anyone to ask. That leads me back to my list how to choose the best function for your needs. From what you had written, I suggest use List::Util::first - it's in core and gets more love from core hackers than LMU. If you want a clarification, by definition List::Util is the better place. Paul is taking suggestions and ideas from L::MU into L::U and provides usually his own implementation. Best regards, Jens