Ray Rahke
04/17/2024, 2:41 AMwhen piece is {
Pawn -> {}
Bishop -> {}
...
}
as opposed to this
if (piece is Pawn) {}
else if (piece is Bishop) {}
ephemient
04/17/2024, 2:47 AMwhen (piece) {
is Pawn -> {}
is Bishop -> {}
as documented… https://kotlinlang.org/docs/control-flow.html#when-expressionRay Rahke
04/17/2024, 2:50 AMArjan van Wieringen
04/17/2024, 5:29 AMVampire
04/17/2024, 8:55 AMHow is this redundant?He probably means repeating
is
Klitos Kyriacou
04/17/2024, 11:47 AMPawn
, Bishop
etc are object
rather than class
, you can leave out the is
.Ray Rahke
04/18/2024, 6:39 AMRay Rahke
04/18/2024, 6:39 AMHe probably means repeatingyeahis
kqr
04/18/2024, 6:42 AMRay Rahke
04/18/2024, 6:42 AMwhen
construct to support a parameterized expressionRay Rahke
04/18/2024, 6:43 AMRay Rahke
04/18/2024, 6:46 AMCLOVIS
04/18/2024, 6:58 AM