X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;ds=sidebyside;f=methods.mtask.tex;h=5b6128d31743f024245e004200458c703daf35b7;hb=5f23e1fc77da5ea47ca9e1f71f7c2e862e0e0df2;hp=a35883a596e5944f5afa91da706fdfee1cd007b3;hpb=d118ff9d857683084065145df45135ef6fa06711;p=msc-thesis1617.git diff --git a/methods.mtask.tex b/methods.mtask.tex index a35883a..5b6128d 100644 --- a/methods.mtask.tex +++ b/methods.mtask.tex @@ -47,10 +47,10 @@ Expressions in the \gls{mTask}-\gls{EDSL} are divided into two types, namely boolean expressions and arithmetic expressions. The class of arithmetic language constructs also contains the function \CI{lit} that lifts a host-language value in to the \gls{EDSL} domain. All standard arithmetic -functions are included but are omitted for brevity. Moreover the class -restrictions are only shown in the first functions and are later omitted. Both -the boolean expression and arithmetic expression classes are shown in -Listing~\ref{lst:arithbool}. +functions are included in the \gls{EDSL} but are omitted in the example for +brevity. Moreover, the class restrictions are only shown in the first functions +and omitted in subsequent funcitons. Both the boolean expression and arithmetic +expression classes are shown in Listing~\ref{lst:arithbool}. \begin{lstlisting}[language=Clean,label={lst:arithbool}, caption={Basic classes for expressions}] @@ -69,13 +69,13 @@ class boolExpr v where \section{Control flow} Looping of \glspl{Task} happens because \glspl{Task} are launched at regular intervals or relaunch themselves. Therefore there is no need for loop control -flow functionality such as \CI{While} or \CI{For} constructions. The main -control flow is the sequence operator and the \CI{If} statement. Both are shown -in Listing~\ref{lst:control}. The first class of \CI{If} statements describe -the regular if statement. The expressions given can have any role. The -functional dependency on \CI{s} determines the return type of the statement. -The sequence operator is very straightforward and just ties the two expressions -together in sequence. +flow functionality such as \emph{while} or \emph{for} constructions. The main +control flow is the sequence operator and the \emph{if} statement. Both are +shown in Listing~\ref{lst:control}. The first class of \emph{If} statements +describe the regular \emph{if} statement. The expressions given can have any +role. The functional dependency on \CI{s} determines the return type of the +statement. The sequence operator is very straightforward and just ties the two +expressions together in sequence. \begin{lstlisting}[% language=Clean,label={lst:control},caption={Control flow operators}] @@ -118,7 +118,7 @@ class assign v where \end{lstlisting} A way of storing data in \glspl{mTask} is using \glspl{SDS}. \glspl{SDS} serve -as variables in the \gls{mTask} and will keep their value across executions. +as variables in the \gls{mTask} and maintain their value across executions. The classes associated with \glspl{SDS} are listed in Listing~\ref{lst:sdsclass}. The \CI{Main} class is introduced to box an \gls{mTask} and make it recognizable by the type system. @@ -134,11 +134,11 @@ class sds v where \section{Example mTask} \todo{Also explain semantics about running tasks} -Some example \glspl{mTask} using almost all of the functionality are show in +Some example \glspl{mTask} using almost all of the functionality are shown in Listing~\ref{lst:exmtask}. The \glspl{mTask} shown in the example do not belong to a particular view and therefore are of the type \CI{View t r}. The \CI{blink} \gls{mTask} show the classic \emph{Arduino} \emph{Hello World!} -application that blinks a certain LED every interval. The \CI{thermostat} +application that blinks a certain LED at each interval. The \CI{thermostat} \gls{mTask} will enable a digital pin powering a cooling fan when the analog pin representing a temperature sensor is too high. \CI{thermostat`} shows the same program but now using the assignment style \gls{GPIO}.