X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTask.dcl;h=b1510af0e520ef727993c938e841cb1abe87293c;hb=8246c6551faa818be7a58638dbbc2e521f21c454;hp=e8f62f205031794ad8446410b3b8a11898d5ef4e;hpb=9f93ff243f8ba2e1924e70df10978060a3b6f461;p=mTask.git diff --git a/mTask.dcl b/mTask.dcl index e8f62f2..b1510af 100644 --- a/mTask.dcl +++ b/mTask.dcl @@ -14,18 +14,15 @@ todo: imporove setp: >>*. */ -import GenPrint -import Generics.gCons -import Generics.gdynamic - -import iTasks - -import iTasks._Framework.Generic -from iTasks._Framework.Task import :: Task +//import iTasks +// +//import iTasks._Framework.Generic +//from iTasks._Framework.Task import :: Task import StdClass import GenEq, StdMisc, StdArray import mTaskCode, mTaskSimulation, mTaskInterpret +//import mTaskCode, mTaskInterpret import mTaskSerial, mTaskLCD // =================== mTask =================== @@ -66,11 +63,11 @@ instance == MTask unMain :: (Main x) -> x class arith v where - lit :: t -> v t Expr | toCode t & toByteCode t + lit :: t -> v t Expr | toCode t & mTaskType t (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | type, +, zero t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q (-.) infixl 6 :: (v t p) (v t q) -> v t Expr | type, -, zero t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q (*.) infixl 7 :: (v t p) (v t q) -> v t Expr | type, *, zero, one t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q - (/.) infixl 7 :: (v t p) (v t q) -> v t Expr | type, / t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q + (/.) infixl 7 :: (v t p) (v t q) -> v t Expr | type, /, zero t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q class boolExpr v where (&.) infixr 3 :: (v Bool p) (v Bool q) -> v Bool Expr | isExpr p & isExpr q //& toExpr2 p & toExpr2 q (|.) infixr 2 :: (v Bool p) (v Bool q) -> v Bool Expr | isExpr p & isExpr q //& toExpr2 p & toExpr2 q @@ -91,7 +88,7 @@ class var2 v where var2 :: t ((v t Upd)->(Main (v c s))) -> (Main (v c s)) | type, toCode t con2 :: t ((v t Expr) ->(Main (v c s))) -> (Main (v c s)) | type t class sds v where - sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | type, toByteCode, toCode t + 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 pub :: (v t Upd) -> v t Expr | type t class seq v where @@ -133,8 +130,8 @@ class time v where millis :: (v Long Expr) class userLed v where - ledOn :: UserLED -> (v () Stmt) - ledOff :: UserLED -> (v () Stmt) + ledOn :: (v UserLED q) -> (v () Stmt) + ledOff :: (v UserLED q) -> (v () Stmt) class pio p t where pio :: p -> v t Upd | aIO v & dIO v instance pio AnalogPin Int @@ -155,6 +152,7 @@ instance type2string Char instance type2string MTask instance type2string DigitalPin instance type2string AnalogPin +instance type2string UserLED instance type2string String instance type2string () class varName a :: a -> String @@ -213,11 +211,9 @@ instance long Eval Long // ----- tools ----- // -derive gPrint Pin, Button, UserLED, AnalogPin, DigitalPin, PinMode -derive class gCons Pin, Button, UserLED, AnalogPin, DigitalPin, PinMode - instance == DigitalPin instance == AnalogPin +instance == UserLED tab =: toString (repeatn tabSize ' ') tabSize :== 2