]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/ImportRef.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / ImportRef.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/ImportRef.scl b/bundles/org.simantics.scl.compiler/tests/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