develooper Front page | perl.perl5.porters | Postings from June 2022

Re: disabling smartmatch and when()?

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
June 20, 2022 16:36
Subject:
Re: disabling smartmatch and when()?
Message ID:
CAHhgV8jZLn+wwb05MO4ZijE5x0f6nFTZbW-z0iC=_qb+XQE7JA@mail.gmail.com
On Mon, Jun 20, 2022 at 4:44 PM Dave Mitchell <davem@iabyn.com> wrote:

> > If you actually want to remove it, then I'm *strongly* opposed. We can't
> > remove smartmatch until we provide a replacement *and* it goes through a
> > proper deprecation cycle (and by "proper" I mean much longer than the
> > usual 2 release cycles).
>
> It's gone through a 9 year deprecation cycle, with a mandatory
> experimental warning that you have to explicitly disable.
>

My understanding is that it can change, not that it's dropped entirely.


> Whether we remove it or change it, its going to break any existing code
> which uses it.
>

In my experience there's a small subset of the functionality that we can't
afford to drop: when ("string"), when (1) (but note that this will
generally work fine if it does stringwise equivalence), when (/regex/) and
when (undef).

The other 90% we can probably drop without much issues I suspect.


> > Smartmatch is *very* widely used in production code and we *completely*
> failed
> > to communicate that it's on its way out.
>
> We have been telling people not to use it for nearly a decade.
>

Not unambiguously. We've left them puzzled mostly.

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About