ResetAtomClasses:
PUBLIC PROC[] ~ {
effects: Resets (i.e. destroys) the global AtomClass DataBase
GlobalAtomClasses ← NIL;
AtomClassNames ← NIL;
};
ResetCompoundClasses:
PUBLIC PROC[] ~ {
effects: Resets (i.e. destroys) the global CompoundClass DataBase
GlobalCompoundClasses ← NIL;
CompoundClassNames ← NIL;
};
InstallAtomClass:
PUBLIC
PROC[class: AtomClass] ~ {
effects: Installs class in global AtomClass DataBase
add atom class to database - not very efficient, but does the job
GlobalAtomClasses ← List.PutAssoc[key: class.name, val: class, aList: GlobalAtomClasses];
add atom class name to index
AtomClassNames ← CONS[class.name, AtomClassNames];
};
InstallCompoundClass:
PUBLIC
PROC[class: CompoundClass] ~ {
effects: Installs class in global CompoundClass DataBase
add compound class to database - not very efficient, but does the job
GlobalCompoundClasses ← List.PutAssoc[key: class.name, val: class, aList: GlobalCompoundClasses];
add compound class name to index
CompoundClassNames ← CONS[class.name, CompoundClassNames];
};
LookupAtomClass:
PUBLIC
PROC[name:
ATOM]
RETURNS[AtomClass] ~ {
effects: Returns the AtomClass object associated with name.
SIGNALS notFound if no association exists
atomClass: AtomClass ← NARROW[List.Assoc[key: name, aList: GlobalAtomClasses]];
IF atomClass = NIL THEN ERROR notFound;
RETURN[atomClass];
};
LookupCompoundClass:
PUBLIC
PROC[name:
ATOM]
RETURNS[CompoundClass] ~ {
effects: Returns the CompoundClass object associated with name.
SIGNALS notFound if no association exists
compoundClass: CompoundClass ← NARROW[List.Assoc[key: name, aList: GlobalCompoundClasses]];
IF compoundClass = NIL THEN ERROR notFound;
RETURN[compoundClass];
};