-- File MergeDefs.mesa
-- Written by Martin Newell, June 1980
-- Last updated: December 1, 1980 8:20 PM
MergeDefs: DEFINITIONS =
BEGIN
MergeValue: TYPE = LONG POINTER;
InitMerge: PUBLIC PROCEDURE [fileName: STRING];
-- Initialize merge to use file fileName
ConsolidateMerge: PUBLIC PROCEDURE;
FinishMerge: PUBLIC PROCEDURE;
-- Close files and release structures
GenMergeValue: PUBLIC PROCEDURE RETURNS[n: MergeValue];
--Generate new Merge value
Merge: PUBLIC PROCEDURE [n1,n2: MergeValue] RETURNS[r: MergeValue];
--Merge numbers n1 and n2 towards smaller of the two
--Returns resulting value of Lookup[n1] (=Lookup[n2])
Lookup: PUBLIC PROCEDURE[n1: MergeValue] RETURNS[n2: MergeValue];
--Return smallest number to which n1 has been merged, transitively closed
--Can be called before FinishMerge
MergeError: PUBLIC ERROR[reason: STRING];
END.