?

x ? y -- compares x and y, returning quote "<", quote ">", or quote "==".

The user may install binary methods for this operator with code such as

              X ? Y := (x,y) -> ...
where X is the class of x and Y is the class of y .
     i1 = 3 ? 4
     
     o1 = <
     
     o1 : Symbol
     
     x < y -- yields "true" or "false" depending on whether x < y.
     
     i2 = "book" ? "boolean"
     
     o2 = <
     
     o2 : Symbol
     
     x < y -- yields "true" or "false" depending on whether x < y.
     
     i3 = 3 ? 3.
     
     o3 = ==
     
     o3 : Symbol
     
     x == y -- a binary operator for testing mathematical equality.
     
     i4 = 3 ? "a"
     
     o4 = >
     
     o4 : Symbol
     
     x > y -- yields "true" or "false" depending on whether x > y.
     
It would be nice to implement an operator like this one for everything in such a way that the set of all things in the language would be totally ordered, so that it could be used in the implementation of efficient hash tables, but we haven't done this. The methods which have been installed for this operator are fairly primitive, and in the end often amount to simply comparing hash codes.

Go to main index.

Go to concepts index.