SEQUENCE

The SEQUENCE type is very similar in syntax to SET type. The major difference is, that the order in which components appear in definition is significant.This also implies some more defferences, which will be mentioned one after another on this page. Sequence types are used commonly instead of set types if any natural order is needed, e.g. in protocols.

The type notation is as follows:

Then, value notation is as follows:

Thus, following notation is not a valid one:

It is also possible to define a sequence type, within which distinctiness is implied by types used. That means, it is sometimes acceptable to omit identifiers. Our example Protocol is one of possible type definitions.

Subtyping possibilities are equal with the SET type considering the fact, that components must keep the order.