On 2/1/2017 2:44 PM, Rowan Collins wrote:
> On 31 January 2017 23:02:07 GMT+00:00, Ryan Pallas
> wrote:
>> I would say compareTo makes sense, because that's what you're
>> asking the method to do. Methods aren't usually past tense as it
>> would seem weird.
>
> To be specific, methods are general
On 31 January 2017 23:02:07 GMT+00:00, Ryan Pallas wrote:
>I would say compareTo makes sense, because that's what you're asking
>the
>method to do. Methods aren't usually past tense as it would seem weird.
To be specific, methods are generally named as "imperative" phrases, because
they are inst
On Tue, Jan 31, 2017 at 3:48 PM, Fleshgrinder wrote:
> Hi :)
>
> I have a few questions regarding the comparable RFC:
>
> https://wiki.php.net/rfc/comparable
>
> Couldn't find the thread in my history and thus cannot respond directly
> to any of the past threads. Maybe not that bad after more tha
Hi :)
I have a few questions regarding the comparable RFC:
https://wiki.php.net/rfc/comparable
Couldn't find the thread in my history and thus cannot respond directly
to any of the past threads. Maybe not that bad after more than a year of
silence. :)
My question might sound silly but I am genu
On Thu, Feb 19, 2015 at 10:40 PM, Adam Harvey 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 vote was li
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: https
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
On Thu, Feb 19, 2015 at 1:40 PM, Adam Harvey 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 vote was like
>> 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 p
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 wrote:
> Another issue: it allows comparing an object to non-objects (even
> though the stated goal is only to compare two objects
> 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: ht
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: https:
On Wed, 06 Oct 2010 16:32:40 +0100, Richard Lynch wrote:
On Tue, October 5, 2010 5:44 am, Gustavo Lopes wrote:
On Tue, 05 Oct 2010 04:31:14 +0100, Richard Lynch wrote:
On Sun, October 3, 2010 12:34 pm, Gustavo Lopes wrote:
* The current behavior for >, <, etc. is completely useless. It's
u
On Tue, October 5, 2010 5:44 am, Gustavo Lopes wrote:
> On Tue, 05 Oct 2010 04:31:14 +0100, Richard Lynch
> wrote:
>
>> On Sun, October 3, 2010 12:34 pm, Gustavo Lopes wrote:
>>> * The current behavior for >, <, etc. is completely useless. It's
>>> unpredictable and it doesn't even establish a tot
On Tue, 05 Oct 2010 04:31:14 +0100, Richard Lynch wrote:
On Sun, October 3, 2010 12:34 pm, Gustavo Lopes wrote:
* The current behavior for >, <, etc. is completely useless. It's
unpredictable and it doesn't even establish a total order:
$a = new stdclass;
$a->prop = null;
$b = new stdclass;
$
On Sun, October 3, 2010 6:18 pm, Stas Malyshev wrote:
>> $a = new stdclass;
>> $a->prop = null;
>> $b = new stdclass;
>> $b->prop2 = null;
>>
>> var_dump($a> $b); //false
>> var_dump($a == $b); //false
>> var_dump($b> $a); //false
>
> That's because there's no total ordering of generic objects th
On Sun, October 3, 2010 12:34 pm, Gustavo Lopes wrote:
> * The current behavior for >, <, etc. is completely useless. It's
> unpredictable and it doesn't even establish a total order:
>
> $a = new stdclass;
> $a->prop = null;
> $b = new stdclass;
> $b->prop2 = null;
>
> var_dump($a > $b); //false
>
On Mon, 04 Oct 2010 00:18:36 +0100, Stas Malyshev
wrote:
* The current behavior for>,<, etc. is completely useless. It's
unpredictable and it doesn't even establish a total order:
$a = new stdclass;
$a->prop = null;
$b = new stdclass;
$b->prop2 = null;
var_dump($a> $b); //false
var_dump($a
Hi!
* The current behavior for>,<, etc. is completely useless. It's
unpredictable and it doesn't even establish a total order:
$a = new stdclass;
$a->prop = null;
$b = new stdclass;
$b->prop2 = null;
var_dump($a> $b); //false
var_dump($a == $b); //false
var_dump($b> $a); //false
That's bec
hi Gustavo,
On Sun, Oct 3, 2010 at 7:34 PM, Gustavo Lopes wrote:
> You raise a fair point -- the motivation to override the comparison operator
> for internal classes is indeed bigger because the state is not in the usual
> places. However:
>
> * The functionality already exists; comparison oper
On Sun, 03 Oct 2010 15:37:41 +0100, Johannes Schlüter
wrote:
On Sun, 2010-10-03 at 15:21 +0100, Gustavo Lopes wrote:
I actually see no reason why we shouldn't expose the compare overload we
already have for internal classes to userspace classes.
For internal classes it is needed, as they
On Sun, 2010-10-03 at 15:21 +0100, Gustavo Lopes wrote:
> On Sun, 03 Oct 2010 15:16:05 +0100, Johannes Schlüter
> wrote:
>
> > On Thu, 2010-09-30 at 22:57 +0800, Adam Harvey wrote:
> >> > On Thu, 30 Sep 2010, Johannes Schlüter wrote:
> >> >> What is this "more interesting stuff to come"?
> >>
>
On Sun, 03 Oct 2010 15:16:05 +0100, Johannes Schlüter
wrote:
On Thu, 2010-09-30 at 22:57 +0800, Adam Harvey wrote:
> On Thu, 30 Sep 2010, Johannes Schlüter wrote:
>> What is this "more interesting stuff to come"?
Nothing that's likely to be ready before the forthcoming release
cycle. I real
On Thu, 2010-09-30 at 22:57 +0800, Adam Harvey wrote:
> > On Thu, 30 Sep 2010, Johannes Schlüter wrote:
> >> What is this "more interesting stuff to come"?
>
> Nothing that's likely to be ready before the forthcoming release
> cycle. I really did just want the RFC writing practice, since I
> haven
On Thu, September 30, 2010 8:33 am, Adam Harvey wrote:
> If there's no great resistance to the concept or implementation, I'm
> happy enough to flip this into the voting stage sooner rather than
> later so we can get it out of the way.
If I'm understanding this correctly, you're going to make it W
For what it's worth, I'm planning to update the RFC later today with
an updated SPL-less patch and the start of a Q&A section similar to
what we've had in the other RFCs. I'll send an e-mail when it's ready.
On 1 October 2010 04:28, Stas Malyshev wrote:
> It is not clear from the RFC, if the engi
Hi!
The RFC is at http://wiki.php.net/rfc/comparable, and the patch at
http://www.adamharvey.name/patches/comparable.diff.txt. Any and all
feedback welcome, particularly since I'm still learning my way around
the innards of the Zend Engine, and it's entirely possible (indeed,
likely) that I've o
On Thu, 30 Sep 2010 16:25:28 +0100, Adam Harvey wrote:
The initial version of the patch actually did just that: it simply
modified zend_std_compare_objects. That's pretty much the cleanest way
you could do it. :)
(...) Additionally, there
are already semantics built into compare_function to ha
On 30 September 2010 23:13, Gustavo Lopes wrote:
> That is, you would only modify zend_std_compare_objects (not
> compare_function!) and add there the additional logic where you'd check if
> the objects had the same class (or perhaps one was of a subclass of the
> other, in which case you'd use th
On Thu, 30 Sep 2010 14:33:05 +0100, Adam Harvey wrote:
I've just written an RFC (with a patch against trunk) to implement a
Comparable interface similar to that in Java — in effect, allowing
object instances to be compared with semantics defined in userspace.
This is admittedly at the lower end
(Omnibus reply, since Johannes's original e-mail hasn't yet dropped
into my ever-so-flaky mail setup. I have read it in full on
news.php.net, though.)
> On Thu, 30 Sep 2010, Johannes Schlüter wrote:
>> What is this "more interesting stuff to come"?
Nothing that's likely to be ready before the for
2010/9/30 Johannes Schlüter :
> On Thu, 2010-09-30 at 16:08 +0200, Kalle Sommer Nielsen wrote:
>> I think its a great addition, but I think the interface should be
>> defined within ZE like the other base interfaces that interact
>> directly with the language syntax (like Iterator) and not in SPL.
On Thu, 30 Sep 2010, Johannes Schlüter wrote:
> On Thu, 2010-09-30 at 21:33 +0800, Adam Harvey wrote:
> > All,
> >
> > I've just written an RFC (with a patch against trunk) to implement a
> > Comparable interface similar to that in Java — in effect, allowing
> > object instances to be compared wi
On Thu, 30 Sep 2010 15:26:17 +0100, Johannes Schlüter
wrote:
On Thu, 2010-09-30 at 16:08 +0200, Kalle Sommer Nielsen wrote:
I think its a great addition, but I think the interface should be
defined within ZE like the other base interfaces that interact
directly with the language syntax (like
On Thu, 2010-09-30 at 16:08 +0200, Kalle Sommer Nielsen wrote:
> I think its a great addition, but I think the interface should be
> defined within ZE like the other base interfaces that interact
> directly with the language syntax (like Iterator) and not in SPL.
s/should/has to/
The engine shall
On Thu, 2010-09-30 at 21:33 +0800, Adam Harvey wrote:
> All,
>
> I've just written an RFC (with a patch against trunk) to implement a
> Comparable interface similar to that in Java — in effect, allowing
> object instances to be compared with semantics defined in userspace.
> This is admittedly at
Hi Adam
2010/9/30 Adam Harvey :
> All,
>
> I've just written an RFC (with a patch against trunk) to implement a
> Comparable interface similar to that in Java — in effect, allowing
> object instances to be compared with semantics defined in userspace.
> This is admittedly at the lower end of RFC-w
All,
I've just written an RFC (with a patch against trunk) to implement a
Comparable interface similar to that in Java — in effect, allowing
object instances to be compared with semantics defined in userspace.
This is admittedly at the lower end of RFC-worthy proposals, but it's
a good system, and
38 matches
Mail list logo