in reply to Re: Modern exposition of "case" or Switch in perl 5.34?
in thread Modern exposition of "case" or Switch in perl 5.34?

At 5.34.0 they remain experimental

And not for no reason. The design of smartmatch is considered fundamentally broken. They want to abandon this experiment, or at least redesign smart matching. The removal of smartmatching is being held back, at least for now, by the number of users of the experimental feature.

Seeking work! You can reach me at ikegami@adaelis.com

  • Comment on Re^2: Modern exposition of "case" or Switch in perl 5.34?

Replies are listed 'Best First'.
Re^3: Modern exposition of "case" or Switch in perl 5.34?
by kcott (Bishop) on Jul 04, 2021 at 20:26 UTC
    "The removal of smartmatching is being held back, at least for now, by the number of users of the experimental feature."

    Yes. Many, including myself, used smartmatch when it was first introduced in 5.10 (when it was not experimental). When it was made experimental in 5.18, many (again, including myself) simply followed the workaround provided in perl5180delta:

    no if $] >= 5.018, warnings => "experimental::smartmatch";

    This removed the copious "experimental" warnings and the code continued to run, without any problems, as it had done previously.

    The result is that now there is a large body of code in CPAN, as well as commercial and private libraries, that use smartmatch. I certainly have private code, still in current use, that uses it; it's entirely possible that commercial code which I wrote prior to 5.18 also included it.

    I suppose the lesson to be learnt here is to make all new features experimental until substantial in-the-field testing indicates no problems. This does seem to be the case for many features (e.g. try/catch in 5.34) but not all (e.g. chained comparisons in 5.32).

    — Ken

Re^3: Modern exposition of "case" or Switch in perl 5.34?
by Bod (Deacon) on Jul 04, 2021 at 18:25 UTC
    The removal of smartmatching is being held back, at least for now, by the number of users of the experimental feature

    Perhaps that shows how useful in demand the feature is.

      That doesn't mean it should be a buggy one.

      Seeking work! You can reach me at ikegami@adaelis.com