Skip to content

Instantly share code, notes, and snippets.

View udalov's full-sized avatar

Alexander Udalov udalov

View GitHub Profile
@udalov
udalov / gist:3820097
Created October 2, 2012 15:24
Multiple constructors workaround
class A() {
var state: Any
}
fun A(state: Any): A {
val a = A()
a.state = state
return a
}
@udalov
udalov / gist:3645169
Created September 5, 2012 21:31
data class example
data class Result(val x: Int, val y: String)
fun computeSomething(): Result {
return Result(42, "")
}
fun main() {
val (x, y) = computeSomething()
println(x)
println(y)