Re: RFC Operator Overloading in Userspace

From: Date: Mon, 01 Feb 2016 22:27:20 +0000
Subject: Re: RFC Operator Overloading in Userspace
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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/

Thread (28 messages)

« previous php.internals (#91053) next »