next up previous contents
Next: 7.2 Querying exported definitions Up: 7. Conditional compilation Previous: 7. Conditional compilation   Contents


7.1 CM variables

CM provides a number of ``variables'' (names that stand for certain integers). These variables may appear in expressions of the conditional-compilation facility. The exact set of variables provided depends on SML/NJ version number, machine architecture, and operating system. A reference to a CM variable is considered an arithmetic expression. If the variable is not defined, then it evaluates to 0. The expression defined($v$) is a boolean expression that yields true if and only if $v$ is a defined CM variable.

The names of CM variables are formed starting with a letter followed by zero or more occurences of letters, decimal digits, apostrophes, or underscores.

The following variables will be defined and bound to 1:

Furthermore, the symbol SMLNJ_VERSION will be bound to the major version number of SML/NJ (i.e., the number before the first dot) and SMLNJ_MINOR_VERSION will be bound to the system's minor version number (i.e., the number after the first dot).

Using the CM.symval interface one can define additional variables or modify existing ones.


next up previous contents
Next: 7.2 Querying exported definitions Up: 7. Conditional compilation Previous: 7. Conditional compilation   Contents
Matthias Blume
2001-07-19