From 848595d1288804d6de43625f9e6f1cf76295c285 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 14 Jun 2017 15:13:32 +0200 Subject: [PATCH] separate share publishing from share class --- mTask.dcl | 1 + mTaskCode.icl | 1 - mTaskInterpret.dcl | 1 + mTaskInterpret.icl | 2 ++ mTaskSimulation.icl | 1 - 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mTask.dcl b/mTask.dcl index 7766d30..955b28a 100644 --- a/mTask.dcl +++ b/mTask.dcl @@ -90,6 +90,7 @@ class var2 v where class sds v where sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | type, mTaskType, toCode t con :: ((v t Expr) ->In t (Main (v c s))) -> (Main (v c s)) | type t +class sdspub v where pub :: (v t Upd) -> v t Expr | type t class seq v where (>>=.) infixr 0 :: (v t p) ((v t Expr) -> (v u q)) -> (v u Stmt) | type t & type u diff --git a/mTaskCode.icl b/mTaskCode.icl index cca5a67..3cec065 100644 --- a/mTaskCode.icl +++ b/mTaskCode.icl @@ -78,7 +78,6 @@ instance sds Code where in setCode Var +.+ c (type2string v + " " + name + " = " + toCode v + ";\n") +.+ setCode Setup +.+ unMain body} con f = defCode f - pub _ = undef defCode :: ((Code t p) -> In t (Main (Code u q))) -> Main (Code u r) | type t defCode f = diff --git a/mTaskInterpret.dcl b/mTaskInterpret.dcl index 9de7c72..67a6857 100644 --- a/mTaskInterpret.dcl +++ b/mTaskInterpret.dcl @@ -152,6 +152,7 @@ instance noOp ByteCode instance retrn ByteCode instance sds ByteCode +instance sdspub ByteCode instance assign ByteCode instance seq ByteCode instance serial ByteCode diff --git a/mTaskInterpret.icl b/mTaskInterpret.icl index f1eeedc..697ce50 100644 --- a/mTaskInterpret.icl +++ b/mTaskInterpret.icl @@ -270,6 +270,8 @@ instance sds ByteCode where addSDS sds v s = {s & sdss=[{sds & sdsval=BCValue v}:s.sdss]} con f = undef + +instance sdspub ByteCode where pub (BC x) = BC $ censor (\[BCSdsFetch s]->[BCSdsPublish s]) x instance assign ByteCode where diff --git a/mTaskSimulation.icl b/mTaskSimulation.icl index 801235e..3f88aee 100644 --- a/mTaskSimulation.icl +++ b/mTaskSimulation.icl @@ -77,7 +77,6 @@ defEval2 v f = instance sds Eval where sds f = defEval f con f = defEval f - pub _ = undef defEval :: ((Eval t p)->In t (Main (Eval u q))) -> (Main (Eval u q)) | dyn t defEval f = -- 2.20.1