poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Syntax for appending elements to arrays


From: Mohammad-Reza Nabipoor
Subject: Re: [RFC] Syntax for appending elements to arrays
Date: Wed, 25 Nov 2020 13:15:44 +0330

Hi, Jose.

On Wed, Nov 25, 2020 at 10:06:16AM +0100, Jose E. Marchesi wrote:
> 
> I think I am inclined for 2) more than for 1), because it makes the
> side-effect more explicit.

:+1:

> 
> A disadvantage of 2) is that not allowing `[1,2,3] + 4' may be
> unexpected for the programmer.
> 

I don't think disallowing `[1,2,3] + 4` is unexpected for the programmer.
IMHO allowing such a thing is unexpected.

I also think `a += [4,5,6]` should be equivalent to

```
a += 4;
a += 5;
a += 6;
```

and not `a = a + [4,5,6]`.


Regards,
Mohammad-Reza


reply via email to

[Prev in Thread] Current Thread [Next in Thread]