Yay! It's one of the top items on my wish list :-) IMHO it helps write cleaner and easier to read code --no ugly intermediate variables set to `null`. It'd be great if we could have the same approach for `for`, `while`, `switch`, `do` and `while`.
That being said, I'm curious: would translating it to a closure call incur performance penalties? -- Bahman On Wed, Sep 27, 2017 at 5:37 AM, Daniel Sun <realblue...@hotmail.com> wrote: > 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? > > Cheers, > Daniel.Sun > > > > -- > Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html