DIRECTORY List, MathDB, MathExpr, AlgebraClasses, Environment, Rope; EnvironmentImpl: CEDAR PROGRAM IMPORTS List, MathDB EXPORTS Environment ~ BEGIN OPEN AC: AlgebraClasses; ROPE: TYPE ~ Rope.ROPE; EXPR: TYPE = MathExpr.EXPR; Object: TYPE = AC.Object; Method: TYPE = AC.Method; Table: List.AList _ NIL; ResetEnvironment: PUBLIC PROC[] ~ { Table _ NIL; }; InstallVariable: PUBLIC PROC[var: ATOM, value: EXPR] ~ { Table _ List.PutAssoc[key: var, val: value, aList: Table]; }; RemoveVariable: PUBLIC PROC[var: ATOM] ~ { Table _ MathDB.KillAssoc[key: var, aList: Table]; }; LookupVariable: PUBLIC PROC[var: ATOM] RETURNS[value: EXPR] ~ { value _ NARROW[List.Assoc[key: var, aList: Table]]; RETURN[value]; }; notFound: PUBLIC ERROR = CODE; ResetEnvironment[]; END. 4EnvironmentImpl.mesa Arnon, April 29, 1987 3:32:19 pm PDT Values for variables Abbreviations from Imported Interfaces The Environment DataBase Operations effects: Resets (i.e. destroys) the Environment effects: Installs value for variable in Environment add to database - not very efficient, but does the job effects: delete the Environment value associated with var, if present. Only needed when want to delete a variable name entirely, not if just want to replace. effects: Returns the value associated with variable. Signals & Errors Start Code Κ%˜Jšœ™J™$J˜J™J˜codešΟk ˜ J˜Kšœ˜Kšœ ˜ Kšœ˜Kšœ ˜ K˜K˜K˜—šΟnœœœ˜Kšœ ˜Kšœ˜K˜K˜Kšœœœ˜K˜—headšž&™&Kšœœœ˜Kšœœ œ˜Kšœœœ˜Kšœœœ˜K˜—šž™Kšžœœ˜—šž™šžœœœ˜#Kšœ%ž ™0Kšœœ˜ K˜K˜—š žœœœœ œ˜8Kšœ)ž ™4K™Kšœ7™7Kšžœ5˜:K˜—K˜šžœœœœ˜*KšœŸ™ŸKšœ1˜1K˜K™—š žœœœœœœ˜?Kšœ5™5K™Kšœœžœ˜3Kšœ˜K˜——šž™Kšœ œœœ˜K˜—šž ™ Kšœ˜K˜K˜—šœ˜K˜——…—a