<<>> <> <> <> <> <<>> DIRECTORY Rope, MathObjects, MathStructures, MathExprs; MathExprsImpl: CEDAR PROGRAM IMPORTS Rope EXPORTS MathExprs = BEGIN <> ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; Object: TYPE = MathObjects.Object; <> ExprDataRep: TYPE ~ RECORD [ SELECT type:* FROM atom => [ method: ATOM, -- type of entity, e.g. $integer, $real, $symbol, $char value: ROPE -- atomic value, e.g. integer as rope. Any legal name (e.g. Greek letter, subscripted variable, etc.) should be an atomic Expr of type $symbol (or we can have types $greekSymbol, $decoratedSymbol, etc., or $name ...). Better to have just one type $symbol, and plan to parse it to determine possible subcomponents, and so the right display. ], compound => [ method: ATOM, -- operator subObjects: LIST OF Object _ NIL -- operands ] ENDCASE ]; ExprData: TYPE ~ REF ExprDataRep; -- inside impl module, use rep <> <> END.