[
https://issues.apache.org/jira/browse/GROOVY-6680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14620691#comment-14620691
]
Keegan Witt commented on GROOVY-6680:
-------------------------------------
I'm with Jochen on this one. I only like adding additional syntaxes if they
make the code more terse and/or readable. In this case, both are equally
readable IMO, and exactly the same concision. Unless you can provide an
example where the alternative syntax is superior, I vote we close this issue.
> Conditional Return
> ------------------
>
> Key: GROOVY-6680
> URL: https://issues.apache.org/jira/browse/GROOVY-6680
> Project: Groovy
> Issue Type: New Feature
> Components: syntax
> Reporter: Kenneth Endfinger
>
> I would like to propose a new feature. the Conditional Return.
> {code}
> void test() {
> // Do Something
> return if [some expression]
> // Do Some More
> return if [some expression]
> }
> {code}
> To me this reads a bit better than
> {code}
> void test() {
> // Do Something
> if ([some expression]) {
> return
> }
> // Do Some More
> if ([some expression]) {
> return
> }
> }
> {code}
> I highly doubt this will be implemented, but it was just an idea I had.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)