ursus
05/14/2026, 9:39 AMfun isZero(point: Pair<Int, Int>): Boolean {
val [x, y] = point // one way
[val x, val y] = point // or another
return x == 0 && y == 0
}
The new positional destructuring syntax, will I be able to use it on my custom tuple types? (quadruple, etc)Youssef Shoaib [MOD]
05/14/2026, 10:25 AMcomponentN functions for whatever N you wantStephan Schröder
05/15/2026, 8:46 AMcomponentN functions are automatically added to data classes but you can manually add them to any class. Don't forget the operator keyword when writting your own componentN functions.
see destructuring declarationsloke
05/16/2026, 3:49 PM