Skip Menu |
 

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

Report information
The Basics
Id: 6859
Status: resolved
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

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



Subject: Documentation assumes overly trivial 'any' implementation
Download (untitled) / with headers
text/plain 965b
In the documentation, the argument for denying any assumes an overly trivial implementation of any/all/none While I totally agree that any(@) would be pointless, what would be of GREAT benefit would be an any(&@) implementation. Technically, it's almost identical to first(&@), but returns true/false rather than the value. As for just doing C< sub any(&@) { !! first(@_) } >, well I've tried it, and it fails for things like any { ! defined $_ } @params The code I normally use to implement it is # The 'any' logical list test sub any(&@) { my $code = shift; foreach ( @_ ) { return 1 if &{$code}(); } ''; } I notice that's quite similar to your first implementation. I imagine the C would be pretty copy/pastable as well ( Not a C person ). In summary, while I agree on the uselessness of any(@) can I convince you to add any(@&) so I can remove it from the 53 locations I've had to implement it myself throughout various modules and projects?
Download (untitled) / with headers
text/plain 270b
And you could probably add ... and would you be sufficiently convinced to add it if I provide a patch against the latest version. I'm reading the first C at the moment, and while not grokking, if needed I will bribe someone to write it, then produce a coherent patch.
From: cpan [...] ali.as
Download (untitled) / with headers
text/plain 107b
The "any" implementation I describe here has been implemented in Test::MoreUtils. You may resolve this bug


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.