Skip Menu |
 

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

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

People
Owner: leonerd-cpan [...] leonerd.org.uk
Requestors: ether [...] cpan.org
Cc:
AdminCc:

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



Subject: documentation should list first version containing new interfaces
Download (untitled) / with headers
text/plain 191b
The documentation should list the first release version that contains sum0 and the other recently-added interfaces, so appropriate dependencies can be declared when these interfaces are used.
Download (untitled) / with headers
text/plain 371b
On 2014-06-04 10:40:00, ETHER wrote: Show quoted text
> The documentation should list the first release version that contains > sum0 and the other recently-added interfaces, so appropriate > dependencies can be declared when these interfaces are used.
sum0: 1.26 any/all/none/notall: 1.33 product: 1.35 pairfirst: 1.30 pairgrep, pairmap, pairs, pairkeys, pairvalues: 1.29 isdual: 1.26
Download (untitled) / with headers
text/plain 592b
On Wed Jun 04 13:43:05 2014, ETHER wrote: Show quoted text
> On 2014-06-04 10:40:00, ETHER wrote:
> > The documentation should list the first release version that contains > > sum0 and the other recently-added interfaces, so appropriate > > dependencies can be declared when these interfaces are used.
Yes; that sounds like a good idea. Show quoted text
> sum0: 1.26 > any/all/none/notall: 1.33 > product: 1.35 > pairfirst: 1.30 > pairgrep, pairmap, pairs, pairkeys, pairvalues: 1.29 > isdual: 1.26
I'll do a bit of digging on the others as well, and see if I can work out a version to put for all of them. -- Paul Evans
Download (untitled) / with headers
text/plain 269b
On Thu Jun 05 10:05:39 2014, PEVANS wrote: Show quoted text
> I'll do a bit of digging on the others as well, and see if I can work > out a version to put for all of them.
Turns out actually most of the other functions are so old that documenting this won't be useful. -- Paul Evans
Subject: rt96220.patch
Download rt96220.patch
text/x-diff 4.2k
diff --git a/lib/List/Util.pm b/lib/List/Util.pm index 5f721f0..1b69259 100644 --- a/lib/List/Util.pm +++ b/lib/List/Util.pm @@ -112,6 +112,8 @@ idea. =head2 $b = any { BLOCK } @list +I<Since version 1.33.> + Similar to C<grep> in that it evaluates C<BLOCK> setting C<$_> to each element of C<@list> in turn. C<any> returns true if any element makes the C<BLOCK> return a true value. If C<BLOCK> never returns true or C<@list> was empty then @@ -126,6 +128,8 @@ instead, as it can short-circuit after the first true result. =head2 $b = all { BLOCK } @list +I<Since version 1.33.> + Similar to C<any>, except that it requires all elements of the C<@list> to make the C<BLOCK> return true. If any element returns false, then it returns false. If the C<BLOCK> never returns false or the C<@list> was empty then it returns @@ -135,6 +139,8 @@ true. =head2 $b = notall { BLOCK } @list +I<Since version 1.33.> + Similar to C<any> and C<all>, but with the return sense inverted. C<none> returns true only if no value in the LIST causes the BLOCK to return true, and C<notall> returns true only if not all of the values do. @@ -190,6 +196,8 @@ empty then C<undef> is returned. =head2 $num = product @list +I<Since version 1.35.> + Returns the numerical product of all the elements in C<@list>. If C<@list> is empty then C<1> is returned. @@ -207,6 +215,8 @@ compatibility, if C<@list> is empty then C<undef> is returned. =head2 $num = sum0 @list +I<Since version 1.26.> + Similar to C<sum>, except this returns 0 when given an empty list, rather than C<undef>. @@ -226,6 +236,8 @@ value - nor even do they require that the first of each pair be a plain string. =head2 $count = pairgrep { BLOCK } @kvlist +I<Since version 1.29.> + Similar to perl's C<grep> keyword, but interprets the given list as an even-sized list of pairs. It invokes the C<BLOCK> multiple times, in scalar context, with C<$a> and C<$b> set to successive pairs of values from the @@ -246,6 +258,8 @@ will be visible to the caller. =head2 $found = pairfirst { BLOCK } @kvlist +I<Since version 1.30.> + Similar to the C<first> function, but interprets the given list as an even-sized list of pairs. It invokes the C<BLOCK> multiple times, in scalar context, with C<$a> and C<$b> set to successive pairs of values from the @@ -266,6 +280,8 @@ will be visible to the caller. =head2 $count = pairmap { BLOCK } @kvlist +I<Since version 1.29.> + Similar to perl's C<map> keyword, but interprets the given list as an even-sized list of pairs. It invokes the C<BLOCK> multiple times, in list context, with C<$a> and C<$b> set to successive pairs of values from the @@ -285,6 +301,8 @@ See L</KNOWN BUGS> for a known-bug with C<pairmap>, and a workaround. =head2 @pairs = pairs @kvlist +I<Since version 1.29.> + A convenient shortcut to operating on even-sized lists of pairs, this function returns a list of ARRAY references, each containing two items from the given list. It is a more efficient version of @@ -309,6 +327,8 @@ the two methods C<key> and C<value>. The following code is equivalent: =head2 @keys = pairkeys @kvlist +I<Since version 1.29.> + A convenient shortcut to operating on even-sized lists of pairs, this function returns a list of the the first values of each of the pairs in the given list. It is a more efficient version of @@ -317,6 +337,8 @@ It is a more efficient version of =head2 @values = pairvalues @kvlist +I<Since version 1.29.> + A convenient shortcut to operating on even-sized lists of pairs, this function returns a list of the the second values of each of the pairs in the given list. It is a more efficient version of diff --git a/lib/Scalar/Util.pm b/lib/Scalar/Util.pm index 4ab67f9..a8733aa 100644 --- a/lib/Scalar/Util.pm +++ b/lib/Scalar/Util.pm @@ -156,6 +156,8 @@ array. =head2 unweaken( REF ) +I<Since version 1.36.> + The lvalue C<REF> will be turned from a weak reference back into a normal (strong) reference again. This function mutates the lvalue passed as its argument and returns no value. This undoes the action performed by @@ -198,6 +200,8 @@ C<$string> in a string context. =head2 $dual = isdual( $var ) +I<Since version 1.26.> + If C<$var> is a scalar that has both numeric and string values, the result is true.
Released in 1.39 -- Paul Evans


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.