Ulrik Brun
02/02/2023, 5:51 PMrook
02/02/2023, 6:01 PMwhen
is an expression whereas switch
is not. It can also be used with arbitrary cases and is not restricted by type. Essentially, it’s completely different from switch-case while still providing all the functionality that we get from switch-case.
https://kotlinlang.org/docs/control-flow.html#when-expressionephemient
02/02/2023, 6:12 PMswitch
expressions, but that was much later than Kotlin's when
)rook
02/02/2023, 6:16 PMephemient
02/02/2023, 6:17 PMUlrik Brun
02/02/2023, 6:20 PMephemient
02/02/2023, 6:21 PMrook
02/02/2023, 6:22 PMCasey Brooks
02/02/2023, 6:23 PMephemient
02/02/2023, 6:23 PMembeddedServer
in code. but that is only for one particular use case; for others, you may need different configurationsUlrik Brun
02/02/2023, 6:25 PMrook
02/02/2023, 6:25 PMUlrik Brun
02/02/2023, 6:26 PMrook
02/02/2023, 6:27 PMephemient
02/02/2023, 6:28 PM