Rafał Trójczak
03/21/2021, 1:52 PMaltavir
03/21/2021, 3:54 PMRafał Trójczak
03/21/2021, 3:55 PMaltavir
03/21/2021, 3:56 PM@DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.3")
altavir
03/21/2021, 3:56 PMRafał Trójczak
03/21/2021, 4:06 PM@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
import kotlinx.coroutines.GlobalScop
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
fun main() {
GlobalScope.launch {
delay(1000L)
println("World!")
}
println("Hello,")
Thread.sleep(2000L)
}
Rafał Trójczak
03/21/2021, 4:06 PMLine_171.jupyter.kts (3:8 - 15) Unresolved reference: kotlinx
Line_171.jupyter.kts (4:8 - 15) Unresolved reference: kotlinx
Line_171.jupyter.kts (5:8 - 15) Unresolved reference: kotlinx
Line_171.jupyter.kts (8:5 - 16) Unresolved reference: GlobalScope
Line_171.jupyter.kts (9:9 - 14) Unresolved reference: delay
altavir
03/21/2021, 4:11 PMRafał Trójczak
03/21/2021, 4:13 PM-jvm
in the @file:DependsOn
line? Like this:
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.3")
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
fun main() {
GlobalScope.launch {
delay(1000L)
println("World!")
}
println("Hello,")
Thread.sleep(2000L)
}
Rafał Trójczak
03/21/2021, 4:13 PMaltavir
03/21/2021, 4:22 PMaltavir
03/21/2021, 4:22 PMRafał Trójczak
03/21/2021, 4:23 PMRafał Trójczak
03/21/2021, 4:23 PMRafał Trójczak
03/21/2021, 4:23 PMRafał Trójczak
03/21/2021, 4:24 PMaltavir
03/21/2021, 4:24 PMmain
works perfectly fine for me. You can also play with the new Notebook API.Rafał Trójczak
03/21/2021, 4:27 PM