This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove proposed (but unimplemented) $foo ~~ Range smart matching.
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 12 May 2009 07:38:29 +0000 (09:38 +0200)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 12 May 2009 07:38:29 +0000 (09:38 +0200)
commitf118ea0d484695c3af550a63cea6055340ab67d7
tree21fce9240eeb9d81de8c1d5f8622c7cbdd0f928e
parentea0c2dbd5f5ac6845ecc7ec6696415bf8e27bd52
Remove proposed (but unimplemented) $foo ~~ Range smart matching.

The reasons for that are :

- $_ ~~ 1..42 actually parses as ($_ ~~ 1) .. 42
- in when(), a range 1..42 will be expanded, and not treated as a
  boolean flip-flop operator
- It will not distribute properly with array smart-matching, as
  in $foo ~~ [1, 2, [4..5]] (that won't match for $foo = 4.2 for
  example.)
op.c
pod/perlsyn.pod
t/op/smartmatch.t
t/op/switch.t