dave08
10/10/2018, 12:56 PMList
of a few different enums with a common property val
? I'd need to be able to retreive the list of entries and get the value of that property for each...spierce7
10/10/2018, 1:02 PMandries.fc
10/10/2018, 1:48 PMBernhard
10/10/2018, 3:19 PMpakoito
10/10/2018, 3:56 PMinline
identifier ensure that the class will be inlined, or is it a hint and there any set of rules to which inline classes do get inlinedShawn
10/10/2018, 4:55 PMDavid W
10/10/2018, 7:25 PMactor
with a delay
in it?otakusenpai
10/10/2018, 8:16 PMJanar
10/11/2018, 6:00 AMfun foo(s: String = "") = "hello $s"
fun bar(a: String?) {
foo(a ?: "")
}
In the above code is there a way for us to use the default value for the parameter in case a
is null, instead of repeating the default value in bar
?
This way, we don’t rely on what the default value of foo
is within bar
BMG
10/11/2018, 8:10 AMinline fun <reified T> Config.xAxis(block: T.() -> Unit, axisType: AxisType) {
xAxis = when (T::class.java) {
NumericAxis::class.java -> {
NumericAxis().apply(block)
}
else -> throw UnsupportedOperationException("currently unsupported")
}
}
Why does it not compile? Any thoughts?legzo
10/11/2018, 8:45 AMjcechace
10/11/2018, 11:23 AMTsvetozar Bonev
10/11/2018, 2:16 PMghedeon
10/11/2018, 2:21 PMIntArray.binarySearch
but that's only for ascending. Arrays.binarySearch
allows you to specify the comparator but only for the Array<T>
, not for the IntArray
. Seems like a dead end.robstoll
10/11/2018, 4:32 PMArray.copy
involved in the following statement:
fun foo(vararg path: String) = Paths.get(*path)
Is there a way to pass an array to Paths.get
as it is possible in Java in order to circumvent the performance penalty?elect
10/12/2018, 9:41 AMinline
within interface
methods?
only private or final methods can have it
Jakub Gwóźdź
10/12/2018, 2:09 PM-
is not part of the number literal?
fun main(args: Array<String>) {
println(-2018.toString().length)
}
prints -4, because method call has higher priority than unaryMinus.
I mean, I understand the reasoning for operators precedence and indeed it makes perfect sense to call the method before making any other operations. But in case of literals it would make much more sense to glue the minus char with the digits. Similarly as the dot between digits is not treated as a method call.arekolek
10/12/2018, 2:16 PMprintln(4-2018.toString().length)
print in your opinion?Jakub Gwóźdź
10/12/2018, 2:34 PMdata class Complex(val re: Double, val im: Double)
nice class and a few operators on it and I was so happy that I can do all this z = z * z + c
thingies, wow Kotlin is so great.
Then I was sooooo happy when I figured out I can add val Double.i get() = Complex(0.0, this)
and simply have val z = 3.5.i
And then, just after that, I saw the "Puzzlers" talk. And tried -3.5.i
. Oh boy...digitalsanctum
10/12/2018, 3:22 PMmarcelo
10/12/2018, 4:33 PMSpek
for the unit tests in IntelliJ, not sure why I'm not able to run it. I installed the Spek Framework plugin.Jason
10/12/2018, 6:06 PMMcEna
10/12/2018, 8:11 PMIcaro Temponi
10/12/2018, 8:33 PMDominaezzz
10/12/2018, 9:03 PMPaolo
10/13/2018, 8:23 AMjcechace
10/13/2018, 5:59 PMclaudiug
10/13/2018, 8:03 PMHamza
10/14/2018, 4:52 AMNikky
10/14/2018, 6:02 PM