Add helpers, compilation function and tests for passing classes as a parameters to a script

This commit is contained in:
Ilya Chernikov
2016-05-30 13:17:48 +02:00
parent bd70481bea
commit 670627ac4e
7 changed files with 106 additions and 25 deletions
+11
View File
@@ -0,0 +1,11 @@
// this script expected parameter param : class { val memberNum: Int }
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
}
System.out.println("num: ${param.memberNum}")
val result = fib(param.memberNum)