Subsections

Summary

United modes introduce no new values. A united mode can have any mode as one of its constituents except a mode which can be firmly coerced to itself. The uniting coercion is available in firm contexts. Because the values supplied to print or read are united, the context of the parameter of those procedures is firm. A conformity clause is used to extract the constituent mode or value. The mode VOID can be one of the constituents of a united mode and is useful to signal an exceptional yield from a procedure. United modes are used in a variety of ways.


Exercises

8.9
Write a declaration for the united mode CRIB whose constituent modes are CHAR, REAL, INT and BOOL. Ans[*]
8.10
Write a declaration for the operator UABS which has a single operand of mode CRIB and which yields the absolute value of its operand. Ans[*]
8.11
Write four formulæ which use UABS and a denotation for each of the constituent modes of CRIB. Ans[*]


Sian Mountbatten 2012-01-19