Hi Stas,
On Sat, Jan 24, 2015 at 8:42 AM, Stanislav Malyshev
wrote:
> > The only reasonable behavior for <==>, <==, >== would be raising
> > error/exception if type differs.
> > E_RECOVERABLE_ERROR may be used.
>
> Comparison operators raising exceptions doesn't sound like a very nice
> thing to
Hi Stas,
> On 23 Jan 2015, at 23:42, Stanislav Malyshev wrote:
>
>> The only reasonable behavior for <==>, <==, >== would be raising
>> error/exception if type differs.
>> E_RECOVERABLE_ERROR may be used.
>
> Comparison operators raising exceptions doesn't sound like a very nice
> thing to work
Hi!
> The only reasonable behavior for <==>, <==, >== would be raising
> error/exception if type differs.
> E_RECOVERABLE_ERROR may be used.
Comparison operators raising exceptions doesn't sound like a very nice
thing to work with.
--
Stas Malyshev
smalys...@gmail.com
--
PHP Internals - PHP R
Hi all,
On Fri, Jan 23, 2015 at 8:05 PM, Andrea Faulds wrote:
> > On 23 Jan 2015, at 10:02, Alain Williams wrote:
> >
> >> On Fri, Jan 23, 2015 at 12:24:25AM +, Andrea Faulds wrote:
> >>
> >> Having it be the same as === would be inconsistent with our existing
> sorting and comparison behav
Hi Alain,
> On 23 Jan 2015, at 10:02, Alain Williams wrote:
>
>> On Fri, Jan 23, 2015 at 12:24:25AM +, Andrea Faulds wrote:
>>
>> Having it be the same as === would be inconsistent with our existing sorting
>> and comparison behaviour, so I don’t think it should be changed. If we made
>>
On Fri, Jan 23, 2015 at 12:24:25AM +, Andrea Faulds wrote:
> Having it be the same as === would be inconsistent with our existing sorting
> and comparison behaviour, so I don’t think it should be changed. If we made
> it strict like that, we’d also have to define a strict < and > as well,
>
Hi Andrea,
On Fri, Jan 23, 2015 at 9:24 AM, Andrea Faulds wrote:
> Having it be the same as === would be inconsistent with our existing
> sorting and comparison behaviour, so I don’t think it should be changed. If
> we made it strict like that, we’d also have to define a strict < and > as
> well
On Fri, Jan 23, 2015 at 9:43 AM, Yasuo Ohgaki wrote:
> Ok. Now I understand. Since we don't/can't define strictly typed
> less/greater than operator,
> it makes sense. It can be handles
>
I always realize silly mistake after I sent mails :(
It can be handled as
>
> if (get_type($a) != get_type($
Hi Yasuo,
> On 23 Jan 2015, at 00:16, Yasuo Ohgaki wrote:
>
> Hi all,
>
> On Fri, Jan 23, 2015 at 7:48 AM, Larry Garfield
> wrote:
>
>> The examples say nothing about mixing types, though. Eg, what would these
>> return:
>>
>> return 0 <=> "0"
>>
>> return "" <=> 0
>>
>> return 1 <=> [1,
Hey Yasuo,
> On 23 Jan 2015, at 00:07, Yasuo Ohgaki wrote:
>
> Ruby has it. Semantics is the same.
> http://ruby-doc.org/core-1.9.3/Comparable.html
>
> PERL has it. Semantics is the same.
> http://perldoc.perl.org/perlop.html#Operator-Precedence-and-Associativity
Yep, and I mentioned as much.
Hi all,
On Fri, Jan 23, 2015 at 7:48 AM, Larry Garfield
wrote:
> The examples say nothing about mixing types, though. Eg, what would these
> return:
>
> return 0 <=> "0"
>
> return "" <=> 0
>
> return 1 <=> [1, 2, 3]
>
> Ignoring object property names and going by the order of the property
> de
Hi Andrea,
On Mon, Jan 19, 2015 at 5:28 PM, Andrea Faulds wrote:
> This is a reboot of Davey Shafik’s RFC (with permission). After recent
> discussions about sort functions, I was inspired to bring this back up, as
> I think it would be a useful feature.
>
> The RFC is here: https://wiki.php.net
Hi again,
> On 22 Jan 2015, at 23:47, Larry Garfield wrote:
>
> Assuming it's accurate and I'm understanding you correctly, I think the
> following would be a sufficient statement for the RFC:
>
> -
> The behavior of this operator with mixed types is such that the following two
> snippets
On 01/22/2015 05:39 PM, Andrea Faulds wrote:
Hi Larry,
On 22 Jan 2015, at 22:48, Larry Garfield wrote:
This looks potentially quite useful, especially for multi-stage comparisons as
you note. Mainly it would mean I don't have to remember which direction is
positive or negative, as I can ne
Hi Larry,
> On 22 Jan 2015, at 22:48, Larry Garfield wrote:
>
> This looks potentially quite useful, especially for multi-stage comparisons
> as you note. Mainly it would mean I don't have to remember which direction
> is positive or negative, as I can never get that right without looking it
On 01/19/2015 08:29 AM, Andrea Faulds wrote:
Hey Nikita,
On 19 Jan 2015, at 14:07, Nikita Popov wrote:
I like the idea behind this (exposing internal compare_function), but I don't
want to have an extra operator for a minor use case. Please just introduce a
function instead.
I originally w
Hi!
> The operator is also less clear ... if I see "$a <=> $b" and do not happen
> to be familiar with another language implementing this operator, I won't
That can be said about every syntax construct - if you never seen it
before, you'd have to learn. <=> is used in Perl, Ruby and Groovy - so
i
Hi Alain,
> On 19 Jan 2015, at 12:53, Alain Williams wrote:
>
> On Mon, Jan 19, 2015 at 12:30:14PM +, Andrea Faulds wrote:
>>
>>
>>> On 19 Jan 2015, at 11:06, Alain Williams wrote:
>>>
>>> I like it.
>>>
>>> The RFC does not say what the precedence is to be. Could I suggest that it
>>>
On Mon, Jan 19, 2015 at 9:28 AM, Andrea Faulds wrote:
> Good morning,
>
> This is a reboot of Davey Shafik’s RFC (with permission). After recent
> discussions about sort functions, I was inspired to bring this back up, as
> I think it would be a useful feature.
>
> The RFC is here: https://wiki.p
Hey Nikita,
> On 19 Jan 2015, at 14:07, Nikita Popov wrote:
>
> I like the idea behind this (exposing internal compare_function), but I don't
> want to have an extra operator for a minor use case. Please just introduce a
> function instead.
I originally wanted a function, but an operator has
Hi Andrea,
On Mon, Jan 19, 2015 at 2:28 AM, Andrea Faulds wrote:
> Good morning,
>
> This is a reboot of Davey Shafik’s RFC (with permission). After recent
> discussions about sort functions, I was inspired to bring this back up, as
> I think it would be a useful feature.
>
> The RFC is here: ht
On Mon, Jan 19, 2015 at 12:30:14PM +, Andrea Faulds wrote:
> Hi Alain,
>
> > On 19 Jan 2015, at 11:06, Alain Williams wrote:
> >
> > On Mon, Jan 19, 2015 at 08:28:17AM +, Andrea Faulds wrote:
> >
> >> The RFC is here: https://wiki.php.net/rfc/combined-comparison-operator
> >
> > I like
Hi Alain,
> On 19 Jan 2015, at 11:06, Alain Williams wrote:
>
> On Mon, Jan 19, 2015 at 08:28:17AM +, Andrea Faulds wrote:
>
>> The RFC is here: https://wiki.php.net/rfc/combined-comparison-operator
>
> I like it.
>
> The RFC does not say what the precedence is to be. Could I suggest that
I wouldn't mind T_SPACESHIP, but T_THREEWAY_COMPARISON is probably more
technically precise and better than T_COMBINED_COMPARISON.
Cheers,
Ben
== Original ==
From: Jordi Boggiano
To: Andrea Faulds
Date: Mon, 19 Jan 2015 12:20:32 +0100
Subject: Re: [PHP-DEV] [RFC] Com
On 19/01/2015 10:40, Andrea Faulds wrote:
Hi Jordi,
On 19 Jan 2015, at 10:37, Jordi Boggiano wrote:
On 19/01/2015 08:28, Andrea Faulds wrote:
Good morning,
This is a reboot of Davey Shafik’s RFC (with permission). After recent
discussions about sort functions, I was inspired to bring this
On Mon, Jan 19, 2015 at 08:28:17AM +, Andrea Faulds wrote:
> The RFC is here: https://wiki.php.net/rfc/combined-comparison-operator
I like it.
The RFC does not say what the precedence is to be. Could I suggest that it be
the same as ''== != === !== <>'' - which keeps it consistent with Perl.
Hi Jordi,
> On 19 Jan 2015, at 10:37, Jordi Boggiano wrote:
>
> On 19/01/2015 08:28, Andrea Faulds wrote:
>> Good morning,
>>
>> This is a reboot of Davey Shafik’s RFC (with permission). After recent
>> discussions about sort functions, I was inspired to bring this back up, as I
>> think it w
On 19/01/2015 08:28, Andrea Faulds wrote:
Good morning,
This is a reboot of Davey Shafik’s RFC (with permission). After recent
discussions about sort functions, I was inspired to bring this back up, as I
think it would be a useful feature.
The RFC is here: https://wiki.php.net/rfc/combined-co
This would be indeed very useful and also ideal from a sorting performance
perspective!
== Original ==
From: Andrea Faulds
To: PHP internals
Date: Mon, 19 Jan 2015 09:28:17 +0100
Subject: [PHP-DEV] [RFC] Combined Comparison (Spaceship) Operator
Good morning,
This is a
Good morning,
This is a reboot of Davey Shafik’s RFC (with permission). After recent
discussions about sort functions, I was inspired to bring this back up, as I
think it would be a useful feature.
The RFC is here: https://wiki.php.net/rfc/combined-comparison-operator
Thanks!
--
Andrea Faulds
30 matches
Mail list logo