From: Mart Lubbers Date: Wed, 14 Jun 2017 13:13:32 +0000 (+0200) Subject: separate share publishing from share class X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=848595d1288804d6de43625f9e6f1cf76295c285;p=mTask.git separate share publishing from share class --- 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 =