X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FRecursiveContext.scl;h=9f8722cfd37dd4792ede40b362939c7b5c61ebb2;hp=7412862116224c3a41886b9eee75df1b6652309a;hb=HEAD;hpb=c08364c64a0bb53c45c052a3e4cea8702bbd69a0 diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/RecursiveContext.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/RecursiveContext.scl index 741286211..9f8722cfd 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/RecursiveContext.scl +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/RecursiveContext.scl @@ -1,23 +1,23 @@ -import "JavaBuiltin" as Java - -infixl 6 (+), (-) - -class Num a where - (+) :: a -> a -> a - (-) :: a -> a -> a - isZero :: a -> Boolean - one :: a - -instance Num Integer where - x + y = Java.iadd x y - x - y = Java.isub x y - isZero x = Java.icmpeq Java.iconst_0 x - one = Java.iconst_1 - -even x = if isZero x then True else odd (x - one) -odd x = if isZero x then False else even (x - one) - -main = odd (8 :: Integer) --- -false - +import "JavaBuiltin" as Java + +infixl 6 (+), (-) + +class Num a where + (+) :: a -> a -> a + (-) :: a -> a -> a + isZero :: a -> Boolean + one :: a + +instance Num Integer where + x + y = Java.iadd x y + x - y = Java.isub x y + isZero x = Java.icmpeq Java.iconst_0 x + one = Java.iconst_1 + +even x = if isZero x then True else odd (x - one) +odd x = if isZero x then False else even (x - one) + +main = odd (8 :: Integer) +-- +false +