Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91053 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84762 invoked from network); 1 Feb 2016 22:28:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2016 22:28:32 -0000 X-Host-Fingerprint: 94.13.91.147 unknown Received: from [94.13.91.147] ([94.13.91.147:15028] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/CB-07168-F0CDFA65 for ; Mon, 01 Feb 2016 17:28:32 -0500 Message-ID: To: internals@lists.php.net References: <12.34.07292.41F9A865@pb1.pair.com> Date: Mon, 1 Feb 2016 22:27:20 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 94.13.91.147 Subject: Re: RFC Operator Overloading in Userspace From: ajf@ajf.me (Andrea Faulds) 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 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/