groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shil Sinha <shil.si...@gmail.com>
Subject Re: New syntax explosion
Date Thu, 05 Oct 2017 22:23:53 GMT
Perhaps it falls into an abuse of exceptions for control flow, but that
would make sense when variable 'a' is not necessarily defined, but if it
is, its member 'b' should be present.

I am also opposed to the new syntaxes outside of !instanceof, !In, and ?=
for assignments.

On Thu, Oct 5, 2017 at 6:06 PM Jesper Steen Møller <jesper@selskabet.org>
wrote:

> 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