RedBlackTreeExtrasImpl.Mesa
Spreitzer, July 12, 1985 4:06:00 pm PDT
DIRECTORY RedBlackTree, RedBlackTreeExtras;
RedBlackTreeExtrasImpl: CEDAR PROGRAM
IMPORTS RedBlackTree
EXPORTS RedBlackTreeExtras
= {OPEN RedBlackTree;
StatelessEnumerateIncreasing: PUBLIC PROC [self: Table, procToApply: EachNode, getKey: GetKey] = {
key: Key ← NIL;
FOR data: UserData ← self.LookupSmallest[], self.LookupNextLarger[key] WHILE data # NIL DO
key ← getKey[data];
IF procToApply[data] THEN EXIT;
ENDLOOP;
};
}.