5 The MLWorks Motif Interface Library

5.2 Type conventions

Differences between the ML and C type systems mean that we have had to adopt certain translation conventions in our implementation. This section describes those conventions.

Where a C function "returns" information by assigning values to a pointer argument, the corresponding ML function returns the information as the result value.

Although the result of a C function indicates success or failure, the corresponding ML function does not. Instead, it indicates failure by raising an exception. Functions with return type unit do not return a useful value.

Where a C function takes a variable number of arguments, the corresponding ML function takes a list. Where one of a set of predefined options needs to be passed to a function, these options are implemented as datatypes. Resources are also implemented as datatypes.

If a C function takes a disjunction of flags combined in a single word, the corresponding ML function takes a list of values. The possible values are specified by a datatype.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker