groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: About if statement in the right hand of assignment statement
Date Wed, 27 Sep 2017 07:25:32 GMT


Am 27.09.2017 um 05:37 schrieb Daniel Sun:
> Hi all,
>
>       I have been thinking about support some syntax like `def x = if (...)
> { ... } else if (...) { ... } else { ... }`, which will be translated to
> `def x = { if (...) { ... } else if (...) { ... } else { ... } }()`
>
>       Any thoughts?

I wonder...

> def x = booleanCondition.
>           iftrue {1}.
>           elseif (anotherCondidition).
>           iftrue {2}.
>           elseif (yetAnotherCondition).
>           iffalse {3}

would something like this be better ?

bye Jochen



Mime
View raw message