develooper Front page | perl.perl5.porters | Postings from December 2017

Re: Revisiting smart match

Thread Previous | Thread Next
Father Chrysostomos
December 28, 2017 21:25
Re: Revisiting smart match
Message ID:
James Keenan wrote:
> On 12/26/2017 08:29 AM, Leon Timmermans wrote:
> > What if we removed it from core, but left enough hooks so that we can
> > republish it as a module (let's call it smartmatch::traditional for the
> > moment). That way users can write code that will work on both previous
> > versions of perl with the current smartmatching, and future perls that
> > have extirpated it from core. Better yet this allows the wider community
> > on CPAN to come up with better smartmatch implementations.
> >     
> > Leon
> That's an idea that warrants serious investigation!

It is already quite possible to implement one's own switch state-
ment, even without removing it from core, using the pluggable
keyword interface (e.g., via Keyword::Simple), and by hooking
PL_check[OP_SMARTMATCH] the way that many existing modules already do
for other ops (e.g., autovivification, arybase).

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About