Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b;
// same as
$a = ($a <=> $b);
Additionally, we should add an is-identical assignment operator:
$a ==== $b;
// same as
$a = ($a === $b);
Thank you for taking this proposal under consideration.
Regards,
Nikita
Hi!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b;
Or maybe we shouldn't? Not only it is quite ugly, I am struggling to
imagine a use case in which one would need such a construct, and I would
recommend rewriting any code that uses such construct.
Additionally, we should add an is-identical assignment operator:
$a ==== $b;
This looks like it is a week early. Maybe that was the intent?
Stas Malyshev
smalyshev@gmail.com
Am 24.3.2016 um 18:50 schrieb Nikita Popov nikita.ppv@gmail.com:
Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b;
// same as
$a = ($a <=> $b);Additionally, we should add an is-identical assignment operator:
$a ==== $b;
// same as
$a = ($a === $b);Thank you for taking this proposal under consideration.
Regards,
Nikita
I see a problem with that … It’d be impossible to make it consistent with is-equal comparison…
=== is already is-identical comparison. So, no symbol for the is-equal assignment operator left.
As long as you don’t have any better suggestion, I’m sorry, but -1 on that.
Bob
$a ==== $b;
// same as
$a = ($a === $b);I see a problem with that … It’d be impossible to make it consistent with is-equal comparison…
=== is already is-identical comparison. So, no symbol for the is-equal assignment operator left.
As long as you don’t have any better suggestion, I’m sorry, but -1 on that.
Perhaps U+FEFF ZERO WIDTH NON-BREAKING SPACE would help disambiguate it?
Morning Nikita,
Thanks for all your hard work.
Since consistency is one of our main focuses, I move that the
discussion period for this extremely important work is moved forward by one
week.
All in favour, say I.
Cheers
Joe
Am 24.3.2016 um 18:50 schrieb Nikita Popov nikita.ppv@gmail.com:
Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b;
// same as
$a = ($a <=> $b);Additionally, we should add an is-identical assignment operator:
$a ==== $b;
// same as
$a = ($a === $b);Thank you for taking this proposal under consideration.
Regards,
NikitaI see a problem with that … It’d be impossible to make it consistent with
is-equal comparison…=== is already is-identical comparison. So, no symbol for the is-equal
assignment operator left.As long as you don’t have any better suggestion, I’m sorry, but -1 on that.
Bob
Morning Nikita,
Apologies for my inconsistent use of language ... I meant to say
shortened by one week.
Cheers
Joe
Morning Nikita,
Thanks for all your hard work. Since consistency is one of our main focuses, I move that the
discussion period for this extremely important work is moved forward by one
week.All in favour, say I.
Cheers
JoeAm 24.3.2016 um 18:50 schrieb Nikita Popov nikita.ppv@gmail.com:
Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b;
// same as
$a = ($a <=> $b);Additionally, we should add an is-identical assignment operator:
$a ==== $b;
// same as
$a = ($a === $b);Thank you for taking this proposal under consideration.
Regards,
NikitaI see a problem with that … It’d be impossible to make it consistent with
is-equal comparison…=== is already is-identical comparison. So, no symbol for the is-equal
assignment operator left.As long as you don’t have any better suggestion, I’m sorry, but -1 on
that.Bob
+1
Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b; // same as $a = ($a <=> $b);
Additionally, we should add an is-identical assignment operator:
$a ==== $b; // same as $a = ($a === $b);
Thank you for taking this proposal under consideration.
Regards,
Nikita
--
Mutlu Koçak | Computer Scientist & Engineer
Mobile: +420775259871
Parizksa 5, Praha 1 Prague Czech Republic
Personal Website: http://www.mtkocak.com
> Hi internals!
>
> For consistency, we should add a spaceship assignment operator:
>
> $a <=>= $b;
> // same as
> $a = ($a <=> $b);
>
I'm not sure I see a use case for this, when do you compare 2 values and
replace one of those values with the result of the comparison? I've
literally never done that.
>
> Additionally, we should add an is-identical assignment operator:
>
> $a ==== $b;
> // same as
> $a = ($a === $b);
>
Again, why would you do this? How often are you replacing the contents of a
variable with the results of comparing it with something else?
$c = $a === $b;
$c = $a <=> $b;
That seems to be far more common if assigning the results to a variable at
all (which is itself not that common for comparisons in my experience).
>
> Thank you for taking this proposal under consideration.
>
> Regards,
> Nikita
>
Thanks for bringing this up, but I don't see the consistency argument, and
I don't feel like its normal use cases at all.
Would your proposal also allow !==== to work?
Colin
Would your proposal also allow !==== to work?
I think you means !===, which is "not-identical assignment" (!== =)
!==== is just CRAZY TALK
-Sara
You're right! Good call :)
On Thu, Mar 24, 2016 at 11:50 AM, Colin O'Dell colinodell@gmail.com
wrote:Would your proposal also allow !==== to work?
I think you means !===, which is "not-identical assignment" (!== =)
!==== is just CRAZY TALK
-Sara
On Thu, Mar 24, 2016 at 11:50 AM, Colin O'Dell colinodell@gmail.com
wrote:Would your proposal also allow !==== to work?
I think you means !===, which is "not-identical assignment" (!== =)
!==== is just CRAZY TALK
We shouldn't dismiss such things out of hand, Sara. Consider the following
argument:
There is a binary !== operator. The compound assignment version of it is
!===. But that again is a binary operator! So there should be a !====
compound assignment operator as well. By induction over the natural numbers
it follows that !== followed by an arbitrary number of =s should be a valid
compound assignment operator.
However, when considering the expansion, we see:
$a !==== $b;
// same as
$a = $a !=== $b;
// same as
$a = $a = $a !== $b;
It is now evident that $a !==== $b (or any additional number of =s) has the
same meaning as $a !=== $b. A difference could only arise if the left-hand
side is an object implementing __set or ArrayAccess, in which case !====
would cause an additional call to __set / offsetSet.
Given that !==== and !=== would be, apart from the edge-case of overloaded
objects, identical, I must concur with your original judgement that only
supporting !=== is sufficient.
Thanks,
Nikita
he is trolling :)
On Thu, Mar 24, 2016 at 8:05 PM, Sara Golemon <pollita@php.net
javascript:;> wrote:On Thu, Mar 24, 2016 at 11:50 AM, Colin O'Dell <colinodell@gmail.com
javascript:;>
wrote:Would your proposal also allow !==== to work?
I think you means !===, which is "not-identical assignment" (!== =)
!==== is just CRAZY TALK
We shouldn't dismiss such things out of hand, Sara. Consider the following
argument:There is a binary !== operator. The compound assignment version of it is
!===. But that again is a binary operator! So there should be a !====
compound assignment operator as well. By induction over the natural numbers
it follows that !== followed by an arbitrary number of =s should be a valid
compound assignment operator.However, when considering the expansion, we see:
$a !==== $b; // same as $a = $a !=== $b; // same as $a = $a = $a !== $b;
It is now evident that $a !==== $b (or any additional number of =s) has the
same meaning as $a !=== $b. A difference could only arise if the left-hand
side is an object implementing __set or ArrayAccess, in which case !====
would cause an additional call to __set / offsetSet.Given that !==== and !=== would be, apart from the edge-case of overloaded
objects, identical, I must concur with your original judgement that only
supporting !=== is sufficient.Thanks,
Nikita
--
Mutlu Koçak | Computer Scientist & Engineer
Mobile: +420775259871
Parizksa 5, Praha 1 Prague Czech Republic
Personal Website: http://www.mtkocak.com
he is trolling :)
I wouldn't dismiss this idea straight off. I can see a lot of practical
uses for chaining assignment operators, like:
$a !==<=>==== $b;
Expanded from:
$a = $a !== (($a <=> $b) === $b);
Which is something I often do in my production applications. In fact I
typed this exact use case about 12 times just today.
It's a good, expressive way of simplifying code and increasing readability.
This would really complete the language IMO.
actually it could be proposed to C in 1970 in a same manner for += operator by saying +== and +=== and also +====. But hence Dennis Ritchie is dead and he accepted += as a founding father, we have no chance to ask him. Can we ask maybe to Bjarne Stroustrup as being one of another founding fathers? Is there anyone being in contact with him?
he is trolling :)
I wouldn't dismiss this idea straight off. I can see a lot of practical
uses for chaining assignment operators, like:$a !==<=>==== $b;
Expanded from:
$a = $a !== (($a <=> $b) === $b);
Which is something I often do in my production applications. In fact I
typed this exact use case about 12 times just today.It's a good, expressive way of simplifying code and increasing readability.
This would really complete the language IMO.
actually it could be proposed to C in 1970 in a same manner for += operator by saying +== and +=== and also +====. But hence Dennis Ritchie is dead and he accepted += as a founding father, we have no chance to ask him. Can we ask maybe to Bjarne Stroustrup as being one of another founding fathers? Is there anyone being in contact with him?
from what I can remember of the PDP-11 instruction set the ++ and -- operators
were put into C because there were op codes that did that, that is what someone
told me some 35 years ago.
We keep them because all Unixy languages have them.
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h
Would your proposal also allow !==== to work?
That would be: !=== (one less '=')
There should also be: === and !== which are the compare-with-type-juggling and
assign operators.
So you have assignment operators: ==== !=== === !==
Comparison operators: === !== == !=
I must confess to checking the date when I first saw the proposal.
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h
Hi Nikita,
Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b; // same as $a = ($a <=> $b);
I miserably fail to imagine any use case for this.
Additionally, we should add an is-identical assignment operator:
$a ==== $b; // same as $a = ($a === $b);
Thank you for taking this proposal under consideration.
Besides the comment about that one from Sara, I also fail to remotely
imagine why one would need that.
In short, yes, it is consistent but it is really unreadable, at best.
--
Pierre
@pierrejoye | http://www.libgd.org
Hi all,
Hi internals!
For consistency, we should add a spaceship assignment operator:
$a <=>= $b; // same as $a = ($a <=> $b);
I miserably fail to imagine any use case for this.
Additionally, we should add an is-identical assignment operator:
$a ==== $b; // same as $a = ($a === $b);
Thank you for taking this proposal under consideration.
Besides the comment about that one from Sara, I also fail to remotely
imagine why one would need that.In short, yes, it is consistent but it is really unreadable, at best.
The same impression.
I suppose there aren't much use cases, are there?
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
I hope this is a joke.
Lets try not to reinvent Perl.
Thanks. Dmitry.