Aristotle Pagaltzis wrote: >Without LHS overloading the given($@) API in autodie is unimplementable. If it's regarded as an API, that was always a faulty one. The matching implemented by the suggested idiom has never actually been what it purported to be, because matching rules other than autodie::exception's ~~ lhs overload would get involved anywhere that the exception was not of that class. We shouldn't be tied down by an erroneous use of an experimental feature. The API that actually works, $@->isa("autodie::exception") && $@->matches("open"), will remain. A working smartmatch-based API, of the form when(autodieish("open")), using objects that overload ~~ from the rhs, is readily achievable. >We promoted that pragma to users as a good idea for years. We can't just >renege on that. You're overstating the case. This wouldn't diminish the functionality or usefulness of the autodie pragma. It only affects the use of autodie *in combination with given*. Admittedly that's a use suggested by the autodie documentation, but code doing it already incurs a "given is experimental" warning. >And to do so we would first have to add an alternative to autodie and to >deprecate the given($@) API for some time. We do not need an alternative to autodie. We only need to change its documentation to stop recommending the faulty use of given. Probably also change its ~~ lhs overload to warn that this facility is going away. Optionally also implement rhs matcher objects in autodie and suggest their use in the documentation. -zeframThread Previous | Thread Next