Re: [VOTE] Userspace operator overloading
| From: | Christoph M. Becker | Date: | Sat, 28 Mar 2020 16:05:15 +0000 |
| Subject: | Re: [VOTE] Userspace operator overloading | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109393@lists.php.net to get a copy of this message | ||
On 28.03.2020 at 15:57, Johannes Schlüter wrote:
> On March 28, 2020 1:25:11 PM GMT+01:00, "Christoph M. Becker"
> <cmbecker69@gmx.de> wrote:
>
>> This "try left/right" approach is how operator overloading works for
>> internal classes[1], and apparently, it works quite well, as long as it
>> is not overused.
>
> The fact that it works in one or two cases as an implementation detail where the full
> implementation is controlled by a single group (internals) is no indication for it to work at large.
Fair enough. But maybe Python, where userland operator overloading
works similar to the proposal at hand, is? :)
Furthermore, it is already possible to do operator overloading in
userland by using the FFI extension[1], and given that operator
overloading appears to be desired by many developers, I'd rather add it
to the language, then having to deal with libraries which do it via FFI.
[1] <https://github.com/lisachenko/z-engine#object-extensions-api>
--
Christoph M. Becker