groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesper Steen Møller <jes...@selskabet.org>
Subject Re: New syntax explosion
Date Thu, 05 Oct 2017 22:06:20 GMT
Hi List

> On 5 Oct 2017, at 20.01, eric.milles@thomsonreuters.com wrote:
> 
> [...] 
> `a??.b.c.` is just `a?.b?.c`
>  

Are there any cases where a?.b.c would every make sense -- if a is null, then the expression
would throw anyway, wouldn't it? Or is there some dynamic mixin case I'm not taking into consideration?

In other words, IMHO a?.b.c should implicitly mean a?.b?.c or at least give a warning that
the construct doesn't make sense. In either case ??. wouldn't make much sense.

As for the other constructs, I'm also not a big fan of introducing lots of new syntax just
because we can.
There is a collateral cost to pay, e.g. in the type checker and static compiler (within the
Groovy project's control), too, and in every AST transformer which needs to know about the
new stuff (out of the Groovyproject's control!) .

-Jesper


Mime
View raw message