DIRECTORY Core USING [CellType], HashTable USING [Table], Rope USING [ROPE]; CoreDirectory: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; CellType: TYPE = Core.CellType; Library: TYPE = HashTable.Table; LibraryNotFound: SIGNAL [name: ROPE]; RegisterLibrary: PROC [library: Library, name: ROPE] RETURNS [sameLibrary: Library]; ForgetLibrary: PROC [name: ROPE]; FetchLibrary: PROC [name: ROPE] RETURNS [library: Library]; CreateLibrary: PROC [] RETURNS [library: Library]; Insert: PROC [library: Library, key: ROPE, ct: CellType, overWrite: BOOL _ FALSE] RETURNS [first: BOOL]; Fetch: PROC [library: REF, key: ROPE] RETURNS [ct: CellType _ NIL]; END. ¦CoreDirectory.mesa Copyright c 1986 by Xerox Corporation. All rights reversed. Created by Christian Jacobi, July 14, 1986 9:50:03 am PDT Last Edited by: Jacobi July 15, 1986 9:33:25 am PDT Bertrand Serlet, July 14, 1986 4:18:27 pm PDT Purpose Defines libraries of Core CellTypes, as well as a global name space for named libraries. No relation between the names of CellTypes in a library and the real name of the CellType is enforced by this package. Types A Library associates a name (ROPE) to a Core CellType. Using equal: HashTable.RopeEqual, hash: HashTable.HashRope. Global name space of libraries Registers library in the global name space. Forgets previous registrations of name. Procedure returns same library again for convenience. Forgets named library. Does not change actual library [but the library can be garbage collected] Fetches a library from the global name space. May raise LibraryNotFound, resume is ok, and in that case returns NIL. Short cuts Creates a new, empty library. Inserts new key-CellType pair into library. overWrite: may overwrite previous association in library Returns first: key was not defined in library before. May raise LibraryNotFound, resume is ok, and in that case no action is taken. Looks up key in library, returns associated CellType (if any). Returns NIL if CellType not found. library: Union of Library & ROPE May raise libraryNotFound, resume is ok, and in that case returns NIL. Κ˜codešœ™Kšœ Οmœ1™™>Kšœ"™"Kšœž™ KšœF™F—K˜—Kšžœ˜K˜J˜J˜—…—˜ Y