develooper Front page | perl.perl5.porters | Postings from September 2016

Re: pounding the smartmatch drum

Thread Previous | Thread Next
Aristotle Pagaltzis
September 7, 2016 19:52
Re: pounding the smartmatch drum
Message ID:
* Sawyer X <> [2016-09-06 17:24]:
> Does anyone object to removing LHS overloading?

I do.

Without LHS overloading the given($@) API in autodie is unimplementable.


Note that the problem isn’t code inside autodie that depends on the LHS
overloading, it’s that the autodie style of given($@) is unimplementable
without LHS overloads – meaning we would have to patch not just autodie
itself but all its callers out in the DarkPAN. Read: we can’t patch that
mistake away.

We promoted that pragma to users as a good idea for years. We can’t just
renege on that.

So LHS overloading is crazy, but we can’t throw it away any time soon.

And to do so we would first have to add an alternative to autodie and to
deprecate the given($@) API for some time.

I would prefer to add it but also attach huge caveats to its docs, maybe
even specifically say that’s it’s really just intended for autodie and
to please not use it otherwise. Likely we should mark it as discouraged
right from the start.

But I don’t know that I’d have any intention of actually removing it. So
far as I can think, autodie users would not gain anything from patching
their code, they only be doing so to allow us to remove LHS overloading.
But if the caveats work to keep people from using it, and it essentially
just serves to keep autodie working unchanged, then I don’t see anything
we gain from removing it either. So in that case, let’s just have it.

I wish autodie hadn’t had that API, because I really really don’t like
LHS overloading… but them’s the breaks. Oh well. As long as people stay
away from it, I’m OK with the necessity of it.

Aristotle Pagaltzis // <>

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