Type System Demo
The applet below illustrates the types of the ports as
they are updated during type resolution.
The type constraints are:
- For each Ramp, the types of the initial value and the step size
are less than or equal to the output type.
- The types of the Expression inputs less than or equal to
the output.
- Each connection requires that the type of the receiving port
is greater than or equal to the type of the sending port.
To see some illustrations of how type resolution works, try the following:
- Using the default parameters, click "go"; the type on all the
ports of the Ramps and the Expression resolve to int,
since all the Ramp parameters are integers.
- Change the Ramp1 step size to 0.5, a double, then click "go".
The output of Ramp1, input1 and the output of the Expression
are resolved to double.
- Change the Ramp1 initial value to the string "A", step size
to the string "BC". (When fires, Ramp1 will generate the
sequence of strings "A", "ABC", "ABCBC", ...) The output
of Ramp1, input1 and output of the Expression will be
resolved to "String", but there is a type conflict between
the output of Expression and the input of the plotter, as
indicated by the message in Java console.