Operations on Public Lists of Expression Class Names, by Expr Type
ResetWorld:
PUBLIC
PROC[] ~ {
LoganBerryLog ← NIL;
OnlineASObjects ← NIL;
};
OnlineASObject:
PROC [in: AlgebraClasses.Object, tryToLink:
BOOL ←
FALSE]
RETURNS [out: AlgebraClasses.Object];
Checks OnlineASObjects to see if already online, if not, loads it and enters it into OnlineASObjects. If tryToLink = TRUE, then for each field which contains one or more AS objects, looks for those objects in OnlineASObjects, and if found, puts pointers to the online versions in the output object. If tryToLink = FALSE, then all such fields are left containing offline objects.
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];
};
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];
};
KillAtomClass:
PUBLIC
PROC[name:
ATOM] ~{
GlobalAtomClasses ← KillAssoc[name, GlobalAtomClasses]
};