Hi Stephen,

Stephen Coakley wrote:

It looks like I'm late to the party for this discussion, but I feel like
this is a similar concept to the already existing Comparable RFC <https://
wiki.php.net/rfc/comparable>, which in my opinion, has a much better
interface. Is this slightly more in-line with what you're thinking with
type classes?

I'd say this RFC should address the Comparable RFC since they are in
direct "conflict" (not quite the right word there). Perhaps instead group
relevant operators into magic interfaces like Comparable, Arithmetic, or
something along those lines.

I'm in favor of operator overloading, but it really needs to be done with
much care.


Yes, the Comparable interface is the sort of thing I'm thinking about. Doing things with interfaces isn't really a terribly novel idea anyway, it's what we already do for ArrayAccess and such.

Thanks.

--
Andrea Faulds
https://ajf.me/

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

Reply via email to