Go to the first, previous, next, last section, table of contents.

Data Type Comparisons

Muq provides native operators such as < and = to compare values, hence must decide what the results of such comparisons should be for any possible pair of values.

In addition, Muq objects allow the use of any values whatever as both keys and values, and maintains (for example) all public keyValue pairs on an object in a sorted tree.

For this to work nicely, it is essential that values compare equal only if they can sensibly be regarded as interchangable, that any pair of values not equal sort into one of the two possible orderings, and that any given unequal pair of values should always sort into the same order.

In light of this, the Muq muf comparison operators are defined over all possible pairs of values. Values not subject to side-effects (characters, integers, floats and strings) are sorted by contents; the remaining values are sorted by their arbitrary internal binary addresses.

Integers and floats intercompare according to normal numeric rules: 2.0 is equal to 2. Except for this values of different types are always unequal.

Properties of the comparison functions not defined above are subject to change in future releases; coding should not depend (for example) on whether strings sort less than or greater than integers.

Go to the first, previous, next, last section, table of contents.