Function: cmp
Section: operators
C-Name: cmp_universal
Prototype: iGG
Help: cmp(x,y): compare two arbitrary objects x and y (1 if x>y, 0 if x=y, -1
 if x<y). The function is used to implement sets, and has no useful
 mathematical meaning.
Doc: gives the result of a comparison between arbitrary objects $x$ and $y$
 (as $-1$, $0$ or $1$). The underlying order relation is transitive,
 the function returns $0$ if and only if $x~\kbd{===}~y$, and its
 restriction to integers coincides with the customary one. Besides that,
 it has no useful mathematical meaning.

 In case all components are equal up to the smallest length of the operands,
 the more complex is considered to be larger. More precisely, the longest is
 the largest; when lengths are equal, we have matrix $>$ vector $>$ scalar.
 For example:
 \bprog
 ? cmp(1, 2)
 %1 = -1
 ? cmp(2, 1)
 %2 = 1
 ? cmp(1, 1.0)   \\ note that 1 == 1.0, but (1===1.0) is false.
 %3 = -1
 ? cmp(x + Pi, [])
 %4 = -1
 @eprog\noindent This function is mostly useful to handle sorted lists or
 vectors of arbitrary objects. For instance, if $v$ is a vector, the
 construction \kbd{vecsort(v, cmp)} is equivalent to \kbd{Set(v)}.

