RefTab: CEDAR DEFINITIONS = BEGIN Ref: TYPE = REF RefTabRep; RefTabRep: PUBLIC TYPE = MONITORED RECORD [mod: CARDINAL, size: INT, data: REF Seq]; Seq: TYPE = RECORD[nodes: SEQUENCE max: SeqIndex OF Node]; SeqIndex: TYPE = CARDINAL[0..4000); Node: TYPE = REF NodeRep; NodeRep: TYPE = RECORD [key: Key, val: Val, next: Node]; Key: TYPE = REF; Val: TYPE = REF; Create: PROC [mod: SeqIndex _ 17] RETURNS [Ref]; GetSize: PROC [x: Ref] RETURNS [INT]; Fetch: PROC [x: Ref, key: Key] RETURNS [found: BOOLEAN, val: Val]; Replace: PROC [x: Ref, key: Key, val: Val] RETURNS [BOOLEAN]; Store: PROC [x: Ref, key: Key, val: Val] RETURNS [BOOLEAN]; Insert: PROC [x: Ref, key: Key, val: Val] RETURNS [BOOLEAN]; Delete: PROC [x: Ref, key: Key] RETURNS [BOOLEAN]; Pairs: PROC [x: Ref, action: EachPairAction] RETURNS [BOOLEAN]; EachPairAction: TYPE = PROC [key: Key, val: Val] RETURNS [quit: BOOLEAN]; END. ΎRefTab.Mesa - definitions for REF table abstraction Copyright c 1985 by Xerox Corporation. All rights reserved. Paxton - August 19, 1982 9:24 am Teitelman - August 31, 1982 2:20 pm Rovner - May 13, 1983 10:39 am Russ Atkinson (RRA) February 5, 1985 2:01:00 pm PST creates new table with suggested hash size returns number of key-value pairs in table looks up key in table, returns associated value (if any) if found is TRUE, val is value associated with given key if found is FALSE, val is NIL returns TRUE after overwriting old value for existing key-value pair if no previous value for key, returns FALSE without inserting new pair returns TRUE after inserting new pair returns FALSE after overwriting old value for existing key-value pair returns TRUE after inserted new pair if previous value existed for key, returns FALSE without changing value deletes key-value pair associated with given key returns TRUE if deletion actually occurred, FALSE if no such key enumerates pairs currently in symbol table in unspecified order pairs inserted/deleted during enumeration may or may not be seen applies action to each pair until action returns TRUE or no more pairs returns TRUE if some action returns TRUE Κc˜codešœ3™3Kšœ Οmœ1™