]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportRef.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / ImportRef.scl
1 importJava "org.simantics.scl.runtime.procedure.Ref" where
2     data Ref a
3     
4     @JavaName "<init>"
5     ref :: a -> <Proc> (Ref a)
6     
7     @JavaName "value"
8     getRef :: Ref a -> <Proc> a
9     
10     @JavaName "<set>value"
11     (:=) :: Ref a -> a -> <Proc> ()
12
13 main = do
14     r = ref (13 :: Integer)
15     r := (14 :: Integer)
16     getRef r
17 --
18 14