Re: [VOTE] User Defined Operator Overloads
| From: | Larry Garfield | Date: | Mon, 03 Jan 2022 16:12:12 +0000 |
| Subject: | Re: [VOTE] User Defined Operator Overloads | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116778@lists.php.net to get a copy of this message | ||
On Mon, Jan 3, 2022, at 9:52 AM, Pierre wrote:
> I personally tend to agree with everything that Marco said. Especially
> regarding the fact that it's adding huge complexity to the language
> itself for mostly edge cases.
>
> I'd argue there's many much more valuable features that could be added
> to PHP before operator overload, such as generics, rationalized
> collection API and scalar objects with methods for example (which all
> could be magnificent tools for improving the operator overload RFC).
Those are all independent of operator overloading. There's zero reason one needs to come
before/after any other. Everyone wants generics, but they're really hard or Nikita would have
implemented them already. This is a non-argument.
Also, people keep talking about edge cases. In my experience, "are these two objects
equal" (for some object-specific definition of equal) is very much *not* an edge case. I may
have less use for overloading % as I don't use advanced math that much, but I compare things
all the frickin' time and that would be incredibly useful day to day.
--Larry Garfield