diesieben07
05/25/2017, 1:26 PMPerson
as this
in scopethymecypher
05/25/2017, 1:30 PMtagantroy
05/25/2017, 2:36 PMrmarinsky
05/25/2017, 3:03 PMenum class
in kotlin have no hidden override fun toString()
, as in a data class?deinspanjer
05/25/2017, 4:07 PMdanko9
05/25/2017, 8:16 PMjealousmango
05/25/2017, 8:53 PMmusachy
05/25/2017, 11:16 PMrichardagreen
05/26/2017, 9:06 AManthony
05/26/2017, 3:12 PMcy
05/26/2017, 3:13 PMdata class Color(val r: Int, val g: Int, val b: Int) {
init {
require(r in 0..255) { "invalid red $r" }
require(g in 0..255) { "invalid red $g" }
require(b in 0..255) { "invalid red $b" }
}
constructor(r: String, g: String, b: String) : this(r.toColorComponent("red"),
g.toColorComponent("green"),
b.toColorComponent("blue"))
}
private fun String.toColorComponent(name: String) = toIntOrNull() ?: throw IllegalArgumentException("Color component $name string is not a number: $this")
deinspanjer
05/26/2017, 8:48 PMdeinspanjer
05/27/2017, 12:46 AMdeinspanjer
05/27/2017, 1:30 AMcedric
05/27/2017, 5:21 AMvararg
requires you to explicitly name the following parameters. Sounds like a compiler weakness since inference is unambiguous heremg6maciej
05/27/2017, 8:35 AMlazy { }
that can be used for other things to have `val`s instead of `var`s.snrostov
05/27/2017, 4:42 PMinline fun <reified T> testException() {
try {
} catch (e: T) { // ERROR: reified type is forbidden for catch parameter
}
}
hansbaum557
05/28/2017, 12:24 AMilya.gorbunov
05/28/2017, 3:37 PMryotamurohoshi
05/28/2017, 4:35 PMKotlin has features for null safety
or Kotlin is langage that has null safety characteristic.
But I have question with words of Kotlin is null safety language
or Kotlin has null safety.
deinspanjer
05/28/2017, 6:28 PMthymecypher
05/29/2017, 4:04 AMkirillrakhman
05/29/2017, 9:06 AMspand
05/29/2017, 12:24 PMlistOf("str", "str", 2, "str")
into sublists based on ie. .class
so the example would become listOf(listOf("str", "str"), listOf(2), listOf("str"))
trevjones
05/29/2017, 7:57 PMrrader
05/30/2017, 2:40 PMhhariri
05/31/2017, 7:03 PMkirillrakhman
05/31/2017, 7:07 PMandrewreitz
05/31/2017, 7:18 PMuser
05/31/2017, 7:26 PMuser
05/31/2017, 7:26 PMmg6maciej
05/31/2017, 8:08 PM