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" 
> <cmbecke...@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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to