]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/GlobalVariables.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / GlobalVariables.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/GlobalVariables.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/GlobalVariables.scl
new file mode 100644 (file)
index 0000000..c6dc99e
--- /dev/null
@@ -0,0 +1,14 @@
+import "Prelude"
+
+global :: Ref Integer
+global = ref 0
+
+inc :: <Proc> ()
+inc = global := getRef global + 1
+
+main = do
+    inc
+    inc
+    getRef global
+--
+2
\ No newline at end of file