manlan
11/24/2020, 5:43 PMRob Elliot
11/24/2020, 5:44 PMmanlan
11/24/2020, 5:45 PMCasey Brooks
11/24/2020, 5:49 PMobject MySingleton {
var aProperty: String = ""
}
fun main() {
MySingleton.aProperty = "another value"
println(MySingleton.aProperty) // prints "another value"
}
Note that this won’t work on Kotlin/Native because of its mutability restrictionsRob Elliot
11/24/2020, 5:50 PMobject Foo {
val x = System.getProperty("goo")
val y = System.getenv()["MY_ENV_VAR"]
}
nanodeath
11/24/2020, 6:09 PMnanodeath
11/24/2020, 6:09 PM