<> <> 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; }; }.