[top][index]
search for:

? -- comparison operator

x ? y -- compares x and y, returning symbol <, symbol >, symbol ==, or incomparable.

The user may install additional 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
i2 : "book" ? "boolean"

o2 = <

o2 : Symbol
i3 : 3 ? 3.

o3 = ==

o3 : Symbol
i4 : 3 ? "a"

o4 = >

o4 : Symbol

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.

This operator may be used as a binary operator in an expression like x ? y. The user may install binary methods for handling such expressions with code such as

              X ? Y := (x,y) -> ...
where X is the class of x and Y is the class of y.

Methods for ? :

  • Sequence ? Sequence
  • BasicList ? BasicList
  • IndexedVariable ? IndexedVariable
  • InfiniteNumber ? InfiniteNumber
  • InfiniteNumber ? Thing
  • RingElement ? RingElement
  • Symbol ? IndexedVariable
  • Tally ? Tally -- comparison of tallies
  • Thing ? InfiniteNumber
  • Thing ? Thing
  • Type ? Type

  • [top][index]
    search for: