Commit 8ce899a8 authored by Luke  Thorpe's avatar Luke Thorpe
Browse files

Improved answer to 'Gap 5'

parent 6face9eb
No preview for this file type
......@@ -430,9 +430,7 @@ Each of the program branches is executed in its own scope, which are denoted by
A scoping statement introduces a new program scope, which is denoted by the \lit{begin} and \lit{end} tokens.
\paragraph{Sequential Composition:}
\hl{This statement composes two statements into one line, to be executed in order. It is denoted by a}
\lit{\hl{;}} \hl{character between the two statements. For example, we can compose the statements s1 and s2 by writing} \lit{\hl{s1 ; s2}} \hl{.}
\hl {Both s1 and s2 must be valid statements for this composed statement to be valid, and s1 will be executed before s2.}
\hl{A sequential composition statement }\lit{\hl{;}}\hl{ (infix) is used to concatenate two statements together such that the second executes after the first. For example, we can compose the statements }\lit{\hl{s1}}\hl{ and }\lit{\hl{s2}}\hl{ by writing }\lit{\hl{s1 ; s2}}\hl{. It should be noted that neither }\lit{\hl{s1}}\hl{ nor }\lit{\hl{s2}}\hl{ need necesarily be singleton statements; they can themselves be the result of composition; it is this repeated process of composition that enables the generation of arbitrarily long sequences of statements. }
\fillgap{\hl{Define/describe sequential composition} \\ \hl{i.e. }\lit*{\hl{<stat> ; <stat>}} }{2 marks}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment