Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Smart matching is experimental/depreciated in 5.18 - recommendations?

by ikegami (Pope)
on Jun 17, 2013 at 20:54 UTC ( #1039472=note: print w/ replies, xml ) Need Help??

in reply to Smart matching is experimental/depreciated in 5.18 - recommendations?

Let's start with some background as to what's going on.

There are problems with the implementation. The decision of what any given TYPE ~~ TYPE should do is most often unobvious, inconsistent and/or disputed. The idea isn't to remove smart matching; it's to fix it.

Specifically, ~~ will be greatly simplified, as you can see in a proposal by the 5.18 pumpking. Decisions as to how two things should match will be done with helpers such as those that already exist in Smart::Match.

... ~~ any(...)

Much more readable, much more flexible (fully extensible), and solves a number of problems (such as "When should X be considered a number, and when should it be considered a string?").

So, if you like the feel of given+when, I recommend that you use experimental to disable the warnings and convert your code to use Smart::Match. Smart::Match uses overloaded objects and/or code refs, and that will continue to be supported. I'm hopeful that Smart::Match will be updated if necessary should the details change.

Comment on Re: Smart matching is experimental/depreciated in 5.18 - recommendations?
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039472]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2016-02-11 03:56 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (358 votes), past polls