]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Fibonacci.scl
Supply SVG text editor with element measurement context
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Fibonacci.scl
1 import "JavaBuiltin" as Java
2
3 (+) = Java.iadd
4 (-) = Java.isub
5 (<=) = Java.icmple
6
7 fibonacci x = if x <= (1 :: Integer) 
8               then 1 :: Integer 
9               else fibonacci (x - 1) 
10                  + fibonacci (x - 2)
11
12 main = fibonacci 10
13 --
14 89