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$ 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)}.