voddan
10/11/2018, 1:13 PMEgor Trutenko
10/11/2018, 1:48 PMmap
it.
doubleArray.map { it.toFloat() }
UPD
As was fairly noticed, map
returns Array<Float>
, which I overlooked. You need to additionally call toFloatArray()
to avoid boxingivano
10/11/2018, 5:03 PMmatt tighe
10/11/2018, 6:57 PMCodeIsmail
10/11/2018, 8:06 PMbitjedi
10/12/2018, 5:47 AMCamilleBC
10/12/2018, 9:10 AMuse()
doc (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/use.html)... Sorry!diego-gomez-olvera
10/12/2018, 10:06 AMvoddan
10/12/2018, 11:58 AMSam
10/12/2018, 9:29 PMval lambda = { value : Int -> executor( value, this ) }
keturn
10/13/2018, 4:28 AMjcechace
10/14/2018, 8:58 AMbuild.gradle.kts
and hint me how to make the project work with latest 1.3.rc and ktor 1.0.0.alpha-3?Nikky
10/14/2018, 10:07 AMfun <T : BaseClass> doThing() : ReturnType
and fun <T> doThing() : ReturnType where T : BaseClass
?
is it just a matter of taste ?Nikky
10/14/2018, 10:36 AM@Deprecated
usecase is a DSLoday
10/14/2018, 11:16 AMShawn
10/15/2018, 5:38 PMNikky
10/15/2018, 8:02 PMhttps://www.youtube.com/watch?v=-y2vW94mBDE▾
Shawn
10/17/2018, 12:33 AMpoohbar
10/17/2018, 3:25 AMpoohbar
10/17/2018, 12:24 PMpoohbar
10/17/2018, 12:24 PMfun foo(input: String = "default")...
val s: String? = "hi"
foo(s) // error
am I missing something?poohbar
10/17/2018, 12:25 PMif (s == null) foo() else foo(s)
ursus
10/19/2018, 3:42 AMmarcelo
10/20/2018, 2:01 AMtag
within my start
method saying:
Required:
Tag<T#1 (type parameter of com.revl.metrics.Timer1.start)>
Found:
Tag<T#2 (type parameter of com.revl.metrics.Timer1)>
ursus
10/20/2018, 2:10 AModay
10/20/2018, 8:03 PMdeas_
10/21/2018, 4:25 PMalwyn
10/21/2018, 7:40 PMskneko
10/22/2018, 1:37 PMSteven McLaughlin
10/22/2018, 5:47 PMBAD
into that function? Essentially, I want to make the when block exhaustive but not change the behavior of the function.
enum class SomeEnum {
GOOD,
BAD
}
fun doTheEnumThing(someEnum: SomeEnum) {
when (someEnum) {
SomeEnum.GOOD -> println("good")
}
}
Steven McLaughlin
10/22/2018, 5:47 PMBAD
into that function? Essentially, I want to make the when block exhaustive but not change the behavior of the function.
enum class SomeEnum {
GOOD,
BAD
}
fun doTheEnumThing(someEnum: SomeEnum) {
when (someEnum) {
SomeEnum.GOOD -> println("good")
}
}
Ruckus
10/22/2018, 5:52 PMfun doTheEnumThing(someEnum: SomeEnum) {
if (someEnum == SomeEnum.GOOD) {
println("good")
}
}
There's no else statement, so nothing happens. It just returns.Steven McLaughlin
10/22/2018, 5:53 PMwhen (someEnum) {
SomeEnum.GOOD -> println("good")
SomeEnum.BAD -> return
}
Ruckus
10/22/2018, 5:55 PMSomeEnum.BAD -> Unit
// or
SomeEnum.BAD -> {}
pavel
10/22/2018, 5:55 PMRuckus
10/22/2018, 5:56 PMpavel
10/22/2018, 5:56 PMSteven McLaughlin
10/22/2018, 5:56 PMRuckus
10/22/2018, 5:57 PMSomeEnum.BAD -> Unit // Do Nothing
// or
SomeEnum.BAD -> {} // Do Nothing
cedric
10/22/2018, 8:18 PMwhen
is a value for an expression, the compiler will mandate exhaustiveness