@kotlin
Kotlin by JetBrains
6 years
New in Kotlin 1.3: Save the subject of a ‘when’ expression into a variable.
Tweet media one
11
191
697

Replies

@digimarktech
Marc Aupont
6 years
0
0
5
@MobileFirstDev
Pierre Liebsch
6 years
@kotlin i want to, but for my copany project you have to release it first :P
0
0
1
@mhshams
Mohammad Sarbandi
6 years
@kotlin Now assignment is also an expression? Or only in this context?
1
0
0
@carloxavier
Carlo
6 years
@kotlin Sounds pretty handy! Just a question about the example above @kotlin , shouldn't there be an else clause on this when expression? i.e we are not using a sealed class
1
0
0
@ant_druha
Andrey Dernov
6 years
@kotlin Thats so cool! Literally yesterday I struggled with such exact need with the "switch" statement in another language:)
0
0
1
@ProgMiner0
ProgMiner
6 years
@kotlin Why you are multiply syntax constructions instead of make assign an expression?
0
0
0
@seyedjafariy
Seyed Jafari
6 years
0
0
1
@OenSam
Sam Oen
6 years
@kotlin Request is not a sealed class, so the when expression is not complete
1
0
0
@charlesmuchene
Charles Muchene
6 years
@kotlin Variable declarations are expressions, assignments still not expressions. 😕
0
0
0