intpair/src/IntPair.i3


Copyright (C) 1994, Digital Equipment Corp.

INTERFACE IntPair;
A pair of integers. Useful as the element type of an array, for sorting purposes, or as a generic argument.

IMPORT Word;

TYPE T = RECORD i, j: INTEGER END (* RECORD *);

CONST Brand = "IntPair";

PROCEDURE Compare(p1, p2: T): [-1..1];
Returns Integer.Compare(p1.i, p2.i)

PROCEDURE CompareJ(p1, p2: T): [-1..1];
Returns Integer.Compare(p1.j, p2.j)

PROCEDURE Equal(ip1, ip2: T): BOOLEAN;
Return whether ip1 and ip2 are the same.

PROCEDURE Hash(ip: T): Word.T;
Return a hash function of ip.

END IntPair.