<<>> <> <> <> <<>> DIRECTORY SafeStorage, IO, Atom, Rope, Basics, MathObjects; MathEnvironments: CEDAR DEFINITIONS = BEGIN <> ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; Object: TYPE = MathObjects.Object; MethodDictionary: TYPE = MathObjects.MethodDictionary; <> <> << >> Environment: TYPE = Object; EnvironmentData: TYPE ~ REF EnvironmentDataRep; -- probably should be a variant record which by default is a RefTab, but optionally a prop list. There should be some way to "concatenate" Environments, e.g. for appending a local scope to an inherited environment. Should check how CedarScheme represents environments EnvironmentDataRep: TYPE; <> <> <> <<>> Environments: Object; EnvironmentsData: TYPE ~ REF EnvironmentsDataRep; -- probably a forest of trees of (all currently active) Environments EnvironmentsDataRep: TYPE; <> EvalOp: MathObjects.BinaryToPairOp; PROC [x: Object, env: Environment] RETURNS [y: Object, newEnv: Environment _ NIL]; <> <> UnpackOp: MathObjects.BinaryOp; <> <> <<-- e specifies e.g. how many levels of unpacking to do, and also whether the current Domain/View S of each unpacked subObject should be "cached" in its unpacked form, via the $foo$[S, ...] convention.>> <> <> <> <<>> <> <<>> <> <> LookupMethod: PROC [key: ATOM, env: Environment] RETURNS[method: Method, class: Object]; <> <> <> <<>> LookupMethodInStructure: PROC [key: ATOM, s: Structure, tryOther: BOOL _ FALSE, env: Environment _ NIL] RETURNS[method: Method, class: Object]; <> <> <<>> AttemptMethod: PROC [method: REF, hint: Structure _ NIL, argList: LIST OF REF, env: Environment] RETURNS[value: REF, newEnv: Environment]; <> <> <> <> <> <<}>> <> <<(if failure, pass back the appropriate SIGNAL)>> <> <<>> <> <<>> END.