Add dependency from annotation extraction mechanisms to the prototype, with tests
This commit is contained in:
committed by
Pavel V. Talanov
parent
3f5a2c2781
commit
402e8c1e3e
+16
@@ -0,0 +1,16 @@
|
||||
|
||||
// this script expected parameter num : Int
|
||||
|
||||
@file:org.jetbrains.kotlin.scripts.depends("@{runtime}")
|
||||
|
||||
fun fib(n: Int): Int {
|
||||
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
|
||||
System.out.println("fib($n)=$v")
|
||||
return v
|
||||
}
|
||||
|
||||
val hdr = "Num".decapitalize()
|
||||
|
||||
System.out.println("$hdr: $num")
|
||||
val result = fib(num)
|
||||
|
||||
Reference in New Issue
Block a user