This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
eviscerate smartmatch
authorZefram <zefram@fysh.org>
Wed, 22 Nov 2017 17:23:57 +0000 (17:23 +0000)
committerZefram <zefram@fysh.org>
Wed, 22 Nov 2017 17:23:57 +0000 (17:23 +0000)
commit5f3202fa3e77c4a20de590df045af4683aaedffa
tree5572a671df6c4586c7d77cf8f98787eb0f457f07
parent5e1cca32ac612f0b59508a99fbff671a693f39b9
eviscerate smartmatch

Regularise smartmatch's operand handling, by removing the implicit
enreferencement and just supplying scalar context.  Eviscerate its runtime
behaviour, by removing all the matching rules other than rhs overloading.
Overload smartmatching in the Regexp package to perform regexp matching.

There are consequential customisations to autodie, in two areas.  Firstly,
autodie::exception objects are matchers, but autodie has been advising
smartmatching with the exception on the lhs.  This has to change to the
rhs, in both documentation and tests.  Secondly, it uses smartmatching as
part of its hint mechanism.  Most of the hint examples, in documentation
and tests, have to change to subroutines, to be portable across Perl
versions.
27 files changed:
Porting/Maintainers.pl
cpan/autodie/lib/autodie/exception.pm
cpan/autodie/lib/autodie/hints.pm
cpan/autodie/t/exceptions.t
cpan/autodie/t/lib/Hints_pod_examples.pm
cpan/experimental/t/basic.t
embed.fnc
embed.h
ext/XS-APItest/t/fetch_pad_names.t
lib/overload.t
op.c
opcode.h
pod/perldiag.pod
pod/perlop.pod
pp_ctl.c
proto.h
regen/opcodes
t/lib/warnings/9uninit
t/lib/warnings/op
t/lib/warnings/utf8
t/op/smartmatch.t
t/op/switch.t
t/op/taint.t
t/op/tie_fetch_count.t
t/porting/customized.dat
t/run/switches.t
universal.c