]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Equations1.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / Equations1.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Equations1.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Equations1.scl
new file mode 100644 (file)
index 0000000..613d56b
--- /dev/null
@@ -0,0 +1,13 @@
+import "Prelude"
+import "Expressions/Equations"
+
+main = v
+  where
+    v = solveEquations do
+        listenEquationVariable "a" $ \a -> setEquationVariable "c" (a-1)
+        setEquationVariable "a" 123
+        listenEquationVariable "a" $ \a -> setEquationVariable "b" (a+1)
+    print v 
+--
+[(a,123), (b,124), (c,122)]
+