You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Daniil Ovchinnikov <da...@jetbrains.com> on 2018/07/05 12:39:34 UTC

[parrot] Command expressions in array initializer

Hi, I just found a good puzzler candidate.

`new int[] { a b, c, d }` is actually `new int[] { a(b, c, d) }`. 

I suggest to drop support for command expressions inside all comma-separated lists to avoid confusion.
It could be easily implemented later in case it will be actually needed.

—

Daniil Ovchinnikov
JetBrains



Re: [parrot] Command expressions in array initializer

Posted by Daniil Ovchinnikov <da...@jetbrains.com>.
Oh wow, I haven’t noticed that.

Main motivation for stopping supporting command expressions in array initializers was that they are not supported in argument lists.
The fact that they are supported in argument lists in 3.x is a breaking change and should be considered a bug, because they were not supported in argument lists in < 3.x.

—

Daniil Ovchinnikov
JetBrains


> On 5 Jul 2018, at 16:41, Daniel.Sun <su...@apache.org> wrote:
> 
> Good suggestion.
> Besides the array initializer, argument list should be considered to stop
> supporting command expression too.
> 
> Cheers,
> Daniel.Sun
> 
> 
> 
> -----
> Daniel Sun 
> Apache Groovy committer 
> Blog: http://blog.sunlan.me 
> Twitter: @daniel_sun 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html


Re: [parrot] Command expressions in array initializer

Posted by "Daniel.Sun" <su...@apache.org>.
Good suggestion.
Besides the array initializer, argument list should be considered to stop
supporting command expression too.

Cheers,
Daniel.Sun



-----
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html