Slackbot
01/11/2024, 10:33 PMChris Lee
01/11/2024, 10:45 PMprivate interface Slot {
operator fun plusAssign(count: Int): Unit
operator fun minus(count: Int): Slot
}
private interface Shelf {
operator fun get(row: Int, col: Int): Slot
operator fun set(row: Int, col: Int, items: Slot)
}
private fun foo() {
val shelf = object: Shelf {
override fun get(row: Int, col: Int): Slot {
TODO()
}
override fun set(row: Int, col: Int, items: Slot) {
TODO()
}
}
val slot = shelf[1, 2]
shelf[1, 2] += 2
shelf[1, 2] = slot - 1
}Alexis Manin
01/12/2024, 7:26 AMAlexis Manin
01/13/2024, 9:52 AM