Start Code
MeddleExprClass: Object ← AC.MakeClass["MeddleExprClass", NIL, NIL];
MeddleExprs: PUBLIC Object ← AC.MakeStructure["MeddleExprs", MeddleExprClass, NIL];
categoryMethod: Method ← AC.MakeMethod[Value, FALSE, NEW[AC.Category ← ring], NIL, "category"];
groundStructureMethod: Method ← AC.MakeMethod[Value, FALSE, NIL, NIL, "groundStructure"];
expressionStructureMethod: Method ← AC.MakeMethod[Value, FALSE, NIL, NIL, "expressionStructure"];
shortPrintNameMethod: Method ← AC.MakeMethod[ToRopeOp, FALSE, NEW[AC.ToRopeOp ← ShortPrintName], NIL, "shortPrintName"];
recastMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Recast], NIL, "recast"];
canRecastMethod: Method ← AC.MakeMethod[BinaryPredicate, TRUE, NEW[AC.BinaryPredicate ← CanRecast], NIL, "canRecast"];
toExprMethod: Method ← AC.MakeMethod[ToExprOp, TRUE, NEW[AC.ToExprOp ← ToExpr], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "toExpr"];
fromExprMethod: Method ← AC.MakeMethod[FromExprOp, TRUE, NEW[AC.FromExprOp ← FromExpr], NIL, "fromExpr"];
legalFirstCharMethod: Method ← AC.MakeMethod[LegalFirstCharOp, FALSE, NEW[AC.LegalFirstCharOp ← LegalFirstChar], NIL, "legalFirstChar"];
readMethod: Method ← AC.MakeMethod[ReadOp, FALSE, NEW[AC.ReadOp ← Read], NIL, "read"];
fromRopeMethod: Method ← AC.MakeMethod[FromRopeOp, TRUE, NEW[AC.FromRopeOp ← FromRope], NIL, "fromRope"];
toRopeMethod: Method ← AC.MakeMethod[ToRopeOp, FALSE, NEW[AC.ToRopeOp ← ToRope], NIL, "toRope"];
parenMethod: Method ← AC.MakeMethod[UnaryOp, FALSE, NEW[AC.UnaryOp ← AC.Copy], NIL, "paren"];
zeroMethod: Method ← AC.MakeMethod[NullaryOp, FALSE, NEW[AC.NullaryOp ← Zero], NIL, "zero"];
oneMethod: Method ← AC.MakeMethod[NullaryOp, FALSE, NEW[AC.NullaryOp ← One], NIL, "one"];
sumMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Add], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "sum"];
negationMethod: Method ← AC.MakeMethod[UnaryOp, TRUE, NEW[AC.UnaryOp ← Negate], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "negation"];
differenceMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Subtract], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "difference"];
productMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Multiply], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "product"];
powerMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Power], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "power"];
fractionMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Divide], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "fraction"];
equalMethod: Method ← AC.MakeMethod[BinaryPredicate, TRUE, NEW[AC.BinaryPredicate ← Equal], NEW[AC.UnaryToListOp ← MeddleExprsDesired], "equals"];
AC.AddMethodToClass[$category, categoryMethod, MeddleExprClass];
AC.AddMethodToClass[$groundStructure, categoryMethod, MeddleExprClass];
AC.AddMethodToClass[$expressionStructure, expressionStructureMethod, MeddleExprClass];
AC.AddMethodToClass[$shortPrintName, shortPrintNameMethod, MeddleExprClass];
AC.AddMethodToClass[$recast, recastMethod, MeddleExprClass];
AC.AddMethodToClass[$canRecast, canRecastMethod, MeddleExprClass];
AC.AddMethodToClass[$toExpr, toExprMethod, MeddleExprClass];
AC.AddMethodToClass[$fromExpr, fromExprMethod, MeddleExprClass];
AC.AddMethodToClass[$legalFirstChar, legalFirstCharMethod, MeddleExprClass];
AC.AddMethodToClass[$read, readMethod, MeddleExprClass];
AC.AddMethodToClass[$fromRope, fromRopeMethod, MeddleExprClass];
AC.AddMethodToClass[$toRope, toRopeMethod, MeddleExprClass];
AC.AddMethodToClass[$paren, parenMethod, MeddleExprClass];
AC.AddMethodToClass[$zero, zeroMethod, MeddleExprClass];
AC.AddMethodToClass[$one, oneMethod, MeddleExprClass];
AC.AddMethodToClass[$sum, sumMethod, MeddleExprClass];
AC.AddMethodToClass[$negation, negationMethod, MeddleExprClass];
AC.AddMethodToClass[$difference, differenceMethod, MeddleExprClass];
AC.AddMethodToClass[$product, productMethod, MeddleExprClass];
AC.AddMethodToClass[$pow, powerMethod, MeddleExprClass];
AC.AddMethodToClass[$fraction, fractionMethod, MeddleExprClass];
AC.AddMethodToClass[$eqFormula, equalMethod, MeddleExprClass];
AC.InstallStructure[MeddleExprs]; -- do it later so methods from other structures found first (currently done in EvaluatorImpl)