Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-20 Thread Dennis Birkholz
Hi Adam, Am 19.02.2015 um 22:40 schrieb Adam Harvey: RFC: https://wiki.php.net/rfc/comparable PR: https://github.com/php/php-src/pull/1097 I see a little problem here by allowing any comparison. Comparing is used for ordering, but you can easily construct ordering mechanisms that simply don't

Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-20 Thread Markus Fischer
On 19.02.15 22:40, Adam Harvey wrote: Those of you with long memories will remember that I proposed a Comparable interface way back in the pre-5.4 days, but withdrew it when it became obvious that there was no consensus for it as a feature and that a vote was likely to fail. RFC:

Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-20 Thread Nikita Popov
On Thu, Feb 19, 2015 at 10:40 PM, Adam Harvey ahar...@php.net wrote: Hi all, Those of you with long memories will remember that I proposed a Comparable interface way back in the pre-5.4 days, but withdrew it when it became obvious that there was no consensus for it as a feature and that a

[PHP-DEV] [RFC] Comparable: the revenge

2015-02-19 Thread Adam Harvey
Hi all, Those of you with long memories will remember that I proposed a Comparable interface way back in the pre-5.4 days, but withdrew it when it became obvious that there was no consensus for it as a feature and that a vote was likely to fail. RFC: https://wiki.php.net/rfc/comparable PR:

Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-19 Thread Levi Morrison
Those of you with long memories will remember that I proposed a Comparable interface way back in the pre-5.4 days, but withdrew it when it became obvious that there was no consensus for it as a feature and that a vote was likely to fail. RFC: https://wiki.php.net/rfc/comparable PR:

Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-19 Thread Adam Harvey
I don't want to get into a lengthy debate (you have your opinion; I have mine!), but to rebut a couple of specific points: On 19 February 2015 at 14:19, Levi Morrison le...@php.net wrote: Another issue: it allows comparing an object to non-objects (even though the stated goal is only to compare

Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-19 Thread Levi Morrison
But even here I would rather just take a function instead of requiring it to be the instance of some interface: function sort($input, callable $comparator($a, $b): int) { /* … */ } Fair, but the sorting case isn't the only one that matters, particularly with = now as part of the

Re: [PHP-DEV] [RFC] Comparable: the revenge

2015-02-19 Thread Pierre Joye
On Thu, Feb 19, 2015 at 1:40 PM, Adam Harvey ahar...@php.net wrote: Hi all, Those of you with long memories will remember that I proposed a Comparable interface way back in the pre-5.4 days, but withdrew it when it became obvious that there was no consensus for it as a feature and that a