Environment.mesa
Arnon, April 29, 1987 3:32:15 pm PDT
Maintain a symbol table (the Environment). Values for variables are EXPRs.
DIRECTORY
MathExpr,
AlgebraClasses,
Rope;
Environment: CEDAR DEFINITIONS ~
BEGIN
Abbreviations from Imported Interfaces
ROPE: TYPE ~ Rope.ROPE;
EXPR: TYPE = MathExpr.EXPR;
DataBase Operations, by Expr Type
ResetEnvironment: PROC[];
effects: Resets (i.e. destroys) the Environment
InstallVariable: PROC[var: ATOM, value: EXPR];
effects: Installs value for variable in Environment
LookupVariable: PROC[var: ATOM] RETURNS[value: EXPR];
effects: Returns the value associated with variable.
SIGNALS notFound if no association exists
RemoveVariable: PROC[var: ATOM];
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.
Signals & Errors
notFound: ERROR;
END.