alex cole
01/10/2021, 1:36 AMtoNumber()
for the following code to follow the kotlin style guide.
class ArrayND {
var data: ArrayList<Double> = {...}
var shape: Array<Int> = {...}
operator fun get(vararg indicies: Int): ArrayND {...}
fun toNumber(): Double {
if (data.size == 1) {
return data[0]
} else {
Throw Error
}
}
}
ephemient
01/10/2021, 1:40 AMfun single() = data.single()
alex cole
01/10/2021, 1:42 AM