The PPC document doesn't actually talk about use overload at all.
In the course of implementing it (Perl/perl5#24304), currently I have fully created an overload category for the equ and === operators, allowing a class to use overload equ => ... to specify its overloading behaviour here.
But I wonder if this should be considered correct, or not. We say that the equ operator's behaviour can be explained in terms of some defined checks and the eq operator. While we allow the eq operator to be overloaded, we don't allow defined to be.
I wonder if therefore, we should say that equ (and related) are not independently overloadable, but instead are just implemented in exactly these terms - a defined check first that cannot be overridden, followed by a possibly-overloaded eq check.
The PPC document doesn't actually talk about
use overloadat all.In the course of implementing it (Perl/perl5#24304), currently I have fully created an overload category for the
equand===operators, allowing a class touse overload equ => ...to specify its overloading behaviour here.But I wonder if this should be considered correct, or not. We say that the
equoperator's behaviour can be explained in terms of somedefinedchecks and theeqoperator. While we allow theeqoperator to be overloaded, we don't allowdefinedto be.I wonder if therefore, we should say that
equ(and related) are not independently overloadable, but instead are just implemented in exactly these terms - adefinedcheck first that cannot be overridden, followed by a possibly-overloadedeqcheck.