Abbreviations from Imported Interfaces
ROPE: TYPE ~ Rope.ROPE;
EXPR: TYPE = MathExpr.EXPR;
Object: TYPE = AC.Object;
Method: TYPE = AC.Method;
DataBase Operations
ResetEnvironment:
PUBLIC
PROC[] ~ {
effects: Resets (i.e. destroys) the Environment
Table ← NIL;
};
InstallVariable:
PUBLIC
PROC[var:
ATOM, value:
EXPR] ~ {
effects: Installs value for variable in Environment
add to database - not very efficient, but does the job
Table ← List.PutAssoc[key: var, val: value, aList: Table];
};
RemoveVariable:
PUBLIC
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.
Table ← MathDB.KillAssoc[key: var, aList: Table];
};
LookupVariable:
PUBLIC
PROC[var:
ATOM]
RETURNS[value:
EXPR] ~ {
effects: Returns the value associated with variable.
value ← NARROW[List.Assoc[key: var, aList: Table]];
RETURN[value];
};