]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Proc3.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Proc3.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Proc3.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Proc3.scl
new file mode 100644 (file)
index 0000000..4a17fe4
--- /dev/null
@@ -0,0 +1,16 @@
+import "Prelude"\r
+\r
+@private\r
+repeat :: Integer -> (() -> <e> a) -> <e> ()\r
+repeat n proc = \r
+    if n > 0 then do\r
+        proc ()\r
+        repeat (n-1) proc\r
+    else () \r
+\r
+main = do\r
+    a = ref 1 \r
+    repeat 3 (\() -> a := 2)\r
+    getRef a\r
+--\r
+2
\ No newline at end of file