Re: null coalesce addition assignment operator ??+=
| From: | Andreas Hennings | Date: | Sat, 20 Jan 2018 01:25:04 +0000 |
| Subject: | Re: null coalesce addition assignment operator ??+= | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101633@lists.php.net to get a copy of this message | ||
On 19 January 2018 at 16:12, Sara Golemon <pollita@php.net> wrote:
> On Thu, Jan 18, 2018 at 7:13 PM, Christoph M. Becker <cmbecker69@gmx.de> wrote:
>> On 18.01.2018 at 23:58, Stanislav Malyshev wrote:
>>
>>>> I propose even more such operators:
>>>> null coalesce addition assignment ??+= (for strings and numbers)
>>>> null coalesce subtraction assignment ??-=
>>>> null coalesce increment ??++
>>>> null coalesce decrement ??--
>>>> null coalesce multiplication assingment ??*=
>>>
>>> I think this is taking it too far. If you want language like that, you
>>> always have APL :)
>>
>> Why do we discuss extensions to an operator which has still (after
>> nearly two years) not be implemented due to implementation difficulties?
>>
> Am I the only one who looked at the original post and assumed he was
> taking the piss?
> Similar to the jokes about spaceship assignment <=>= and
> equality/identicality assignment === (not to be confused with
> identical non-assign, which is ===) and ====.
I can definitely say it was not a joke.
I can see myself and others use the ??+= and also ??++, and would have
used them in the past, if they had been available.
The others, I don't care as much.
For me, a good enough conclusion of this conversation would be one of:
A: Yeah seems useful, but let's wait (or work) until ??= is
implemented and released, and observe how it is being used.
B: No one will ever use it, and it would hurt the language.