DIRECTORY AlgebraClasses, Exprs; ExprsImpl: CEDAR PROGRAM IMPORTS AlgebraClasses EXPORTS Exprs = BEGIN OPEN AC: AlgebraClasses; Object: TYPE = AC.Object; Method: TYPE = AC.Method; Recast: AC.UnaryOp = { toExprMethod: Method _ AC.LookupMethodForStructure[$toExpr, arg.class]; RETURN[AC.ApplyMethodNoChecks[toExprMethod, LIST[arg] ]; }; CanRecast: AC.UnaryPredicate = { RETURN[TRUE]; }; ExprsClass: Object _ AC.MakeClass["ExprsClass", NIL, NIL]; Exprs: PUBLIC Object _ AC.MakeStructure["Exprs", ExprsClass, NIL]; categoryMethod: Method _ AC.MakeMethod[Value, FALSE, Exprs, NEW[AC.Category _ set], NIL, NIL]; recastMethod: Method _ AC.MakeMethod[UnaryOp, TRUE, Exprs, NEW[AC.UnaryOp _ Recast], NIL, "recast"]; canRecastMethod: Method _ AC.MakeMethod[UnaryPredicate, TRUE, Exprs, NEW[AC.UnaryPredicate _ CanRecast], NIL, "canRecast"]; toExprMethod: Method _ AC.MakeMethod[ToExprOp, TRUE, Exprs, NEW[AC.ToExprOp _ ToExpr], NEW[AC.UnaryToListOp _ AC.DefaultDesiredArgStructures], "toExpr"]; compoundExprMethod: Method _ AC.MakeMethod[BinaryOp, TRUE, Exprs, NEW[AC.BinaryOp _ MakeCompoundExpr], NIL, "compoundExpr"]; AC.AddMethodToClass[$category, categoryMethod, ExprsClass]; AC.AddMethodToClass[$recast, recastMethod, ExprsClass]; AC.AddMethodToClass[$canRecast, canRecastMethod, ExprsClass]; AC.AddMethodToClass[$toExpr, toExprMethod, ExprsClass]; AC.AddMethodToClass[$compoundExpr, compoundExprMethod, ExprsClass]; AC.InstallStructure[Exprs]; END. ExprsImpl.mesa Last Edited by: Arnon, July 19, 1985 2:54:46 pm PDT Types Miscellaneous Procs ToExpr: AC.ToExprOp = { -- Should become a noop when MathExpr.EXPR redone as Object data: IntData _ NARROW[in.data]; RETURN[MathConstructors.MakeInt[Convert.RopeFromInt[data^] ] ]; }; MakeCompoundExpr: AC.BinaryOp = { -- Should become a BinaryOp when MathExpr.EXPR redone as Object }; Start Code Κt˜Jšœ™J™3J™šΟk ˜ J˜Jšœ˜—J˜head2šœ œ˜Jšœ˜JšœΟn˜ J˜—Jšœœœœ˜ headšž™Icodešœœœ˜Mšœœœ˜—šž™šžœœ ˜Mšœœ.˜GJšœœ#œ˜8Jšœ˜J˜—šž œœ˜ Mšœœ˜ Jšœ˜—J˜šžœœI™SMšœœ ™ Jšœ9™?Jšœ™J™—šžœœM™aJšœ™J™——™ M˜Jšž œ œœœ˜:Jšžœœ œ$œ˜BJ˜J˜Jš œœœ œœœœ˜^Jš œœœ œœœ ˜dJš œœœ œœœ˜{Jšœœœ œœœœœ)˜™Jš œœœ œœ žœœ˜|J˜Jšœ9˜;Jšœ5˜7Jšœ;˜=Jšœ5˜7JšœA˜CJ˜Jšœžœ˜J˜J˜—Jšœ˜J˜J˜—…—Ά Ί