To be honest, the only use case for this idiom I (or my colleagues) ever came across is the one you mentioned in the post. Expressions with side effects are generally discouraged, so I think we do well enough in this case.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Why I can't apply value inside while loop? | 13 | 20819 | October 25, 2019 | |
Assignments are not expressions and only expressions are allowed in this context | 1 | 7555 | January 15, 2018 | |
Assignments as expressions | 1 | 4665 | March 29, 2016 | |
Strange null-check behavior
|
2 | 928 | March 22, 2012 | |
(Assignment expressions) Kotlin Syntax | 2 | 1348 | November 25, 2020 |