Array ordering

Array ordering is the ordering of arrays exposed by functions such as Grade and Interval Index. It may be more general than comparison, for example by allowing characters to be compared to each other and to numbers. However, not all arrays need to be comparable, meaning that functions that depend on array ordering can throw an error. Traditionally, ordering is defined only for simple arrays of the same shape and type (Grade of a simple array only requires this sort of comparison), and is determined by the ordering of the first unequal pair of elements in those arrays in ravel order. It may be extended to all arrays in various ways, making it a total array order (TAO).

While two characters can't be compared directly in most APL implementations, their array ordering can be observed with Grade: Grade reverses the order of these elements, showing that  comes before   in the array ordering. In general,  tests whether array   precedes or matches. However,  doesn't distinguish between these two cases, so for complete information about the ordering, these arrays must also be graded in the opposite order.

Documentation

 * Dyalog APL
 * J
 * BQN