in-memory compilation of standalone script

This commit is contained in:
Alex Tkachman
2012-07-28 20:32:18 +03:00
parent 0b327d29bc
commit b8bfde3102
7 changed files with 169 additions and 34 deletions
+10
View File
@@ -0,0 +1,10 @@
// this script expected parameter num : 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: $num")
val result = fib(num)