For both the COLLECTION and GENERIC statements, differences between types are accommodated by the following @$ conditional-compilation entities:
which may be nested. Also, @$ORIF acts as a qualified ELSE that does not create an additional depth of nesting (turning an IF into an ORDSEL, in effect).
An @$ENDIF is required for every @$IF.
Other conditions, such as @$IF constant-name=constant-value, are also possible, although less badly needed.
It is hoped that programmers will not be confused by the use of different forms of IF for conditional compilation and conditional execution; it is felt that the most appropriate form of IF was used in each context.
The collection statement has the form
COLLECTION type-symbol:type-symbol:type-symbol...; type-name:type-name:type-name...,routine-name, type-name:type-name:type-name...,routine-name,... type-name:type-name:type-name...,routine-name
and causes the FUNCTION or SUBROUTINE following it to be compiled once for each type-name...routine-name entry, with each type-symbol (an identifier) replaced by the corresponding type-name, and having the name routine-name instead of the one given.
Since separate externally-compiled subroutines are being generated, the routine-name parameters cannot be omitted.
Note that unlike the GENERIC subroutine type in Ada, this forces compilation for every set of types given, creating routines that are externally-compiled.