In this lesson, we show how we can add and remove processes to a system during execution. To illustrate that, we will use a simple graphical application which displays a moving point.
We define the state of a moving point by a record containing the color of the point, and two signals that represent respectively the flows of positions and velocities of the point.
type state = { color: Graphics.color; pos: (float * float, float * float) event; vel: (float * float, float * float) event; }
At each instant, the position and velocity of a point are represented by a pair of floats.