groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milles, Eric (TR Technology)" <eric.mil...@thomsonreuters.com>
Subject RE: Local variable declaration enhancements -- statement scoping
Date Wed, 02 Dec 2020 16:40:14 GMT
Maybe the "if" could forward declare the name(s) like this when not relying on Groovy truth:

if (def x; (x = ...) != null) {
}

---------

if (def x = ...) { // tests Groovy truth in this form; may be wrapped in parens to check something
else about "x"
}
Mime
View raw message