Eugen Martynov
02/12/2021, 9:15 AMoperator fun <T> T.plus(list: List<T>): List<T> {
val result = list.toMutableList()
result.add(0, this)
return result
}
Big Chungus
02/12/2021, 9:20 AMBig Chungus
02/12/2021, 9:20 AMGiorgos Neokleous
02/12/2021, 9:27 AMT
to avoid polluting the namespace of pretty much everything. This will require to do mutableListOf<Int>() + 2
instead of 2 + mutableListOf<Int>()
Eugen Martynov
02/12/2021, 9:44 AMlistOf(1) + 2
Eugen Martynov
02/12/2021, 9:46 AMEugen Martynov
02/12/2021, 10:39 AMtoMutableList()
will create a separate list with copy of the original, so original will stay without changes.Eugen Martynov
02/12/2021, 10:39 AMNir
02/12/2021, 2:53 PMNir
02/12/2021, 2:55 PMMatteo Mirk
02/12/2021, 3:39 PMEugen Martynov
02/15/2021, 9:49 AM