X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperl5110delta.pod;h=ea62b67c57980581a1b9bca3ecfb8fb2e0d5daa1;hb=92a24ac3df5779ed0c9681cafefdd31fc6e1ae98;hp=54292e054d15208544fe6576ec4c63551650a6c7;hpb=9091a618773bfbb9dc94067f69bea900a2c09c1d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perl5110delta.pod b/pod/perl5110delta.pod index 54292e0..ea62b67 100644 --- a/pod/perl5110delta.pod +++ b/pod/perl5110delta.pod @@ -42,8 +42,9 @@ of the switch statements where smart matching is implicitly used. The smart match operator C<~~> is no longer commutative. The behaviour of a smart match now depends primarily on the type of its right hand -argument. While the general backwards compatibility is maintained, -several changes must be noted: +argument. Moreover, its semantics has been adjusted for greater +consistency or usefulness in several cases. While the general backwards +compatibility is maintained, several changes must be noted: =over 4 @@ -62,6 +63,12 @@ the subroutine. =item * +Due to the commutativity breakage, code references are no longer +treated specially when appearing on the left of the C<~~> operator, +but like any vulgar scalar. + +=item * + C is always false (since C can't be a key in a hash). No implicit conversion to C<""> is done (as was the case in perl 5.10.0). @@ -88,9 +95,9 @@ appear on the left, the overload routine will be called only when the rightmost argument is a simple scalar. This way distributivity of smart match across arrays is not broken, as well as the other behaviours with complex types (coderefs, hashes, regexes). Thus, writers of overloading routines -for smart match need to worry only with comparing against a scalar, and -possibly with stringification overloading; the other cases will be -automatically handled consistently. +for smart match mostly need to worry only with comparing against a scalar, +and possibly with stringification overloading; the other common cases +will be automatically handled consistently. C<~~> will now refuse to work on objects that do not overload it (in order to avoid relying on the object's underlying structure).