better serial integration, moved things outside
[mTask.git] / mTaskInterpret.icl
index c63c95d..4876e93 100644 (file)
@@ -1,7 +1,9 @@
 implementation module mTaskInterpret
 
 //import iTasks
-import gdynamic, gCons, GenEq, StdMisc, StdArray, GenBimap
+import Generics.gCons
+
+import GenEq, StdMisc, StdArray, GenBimap
 import GenPrint
 import StdEnum
 import mTask
@@ -227,9 +229,9 @@ instance zero BCState where
        zero = {freshl=[1..], freshs=[1..], sdss=[]}
 
 
-toRealByteCode :: (ByteCode a b) -> (String, BCState)
-toRealByteCode x
-# (bc, st) = runBC x zero
+toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)
+toRealByteCode x s
+# (bc, st) = runBC x s
 # (bc, gtmap) = computeGotos bc 1
 = (concat $ map (toString o toByteVal) (map (implGotos gtmap) bc), st)
 
@@ -263,7 +265,7 @@ toMessages interval (bytes, st=:{sdss}) = ([MTSds i (toString b)\\(i,b)<-sdss] +
 toSDSUpdate :: Int Int -> [MTaskMSGSend]
 toSDSUpdate i v = [MTUpd i (to16bit v)]
 
-Start = toMessages 500 $ toRealByteCode (unMain bc)
+Start = toMessages 500 $ toRealByteCode (unMain bc) zero
        where
                bc = sds \x=5 In 
                        sds \y=4 In