Andrew
01/26/2021, 5:02 AMclass MyObject(private val a: Int, private val b: Double) {
constructor(str: String) : this(parse(str))
companion object {
private fun parse(str: String): ???
}
}
Is there anything that would allow this to work? Currently I have to create 2 parse functions, one to get the first and another for the second value I need.Nir
01/26/2021, 5:26 AMNir
01/26/2021, 5:27 AMNir
01/26/2021, 5:27 AMNir
01/26/2021, 5:28 AMephemient
01/26/2021, 5:41 AMfun MyObject(...)
. this is what stdlib does for List()
and a few othersAndrew
01/26/2021, 6:46 AM