]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportRef.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / ImportRef.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportRef.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportRef.scl
new file mode 100644 (file)
index 0000000..9fb6f62
--- /dev/null
@@ -0,0 +1,18 @@
+importJava "org.simantics.scl.runtime.procedure.Ref" where\r
+    data Ref a\r
+    \r
+    @JavaName "<init>"\r
+    ref :: a -> <Proc> (Ref a)\r
+    \r
+    @JavaName "value"\r
+    getRef :: Ref a -> <Proc> a\r
+    \r
+    @JavaName "<set>value"\r
+    (:=) :: Ref a -> a -> <Proc> ()\r
+\r
+main = do\r
+    r = ref (13 :: Integer)\r
+    r := (14 :: Integer)\r
+    getRef r\r
+--\r
+14
\ No newline at end of file