DIRECTORY MathExpr, MathRules, MathDB, MathTypes, MathBox, Imager, Rope, Vector, MathConstructors; ChangeQuote: CEDAR PROGRAM IMPORTS MathBox, MathRules, MathExpr, MathDB, MathConstructors ~ BEGIN EXPR: TYPE ~ MathExpr.EXPR; BOX: TYPE ~ MathBox.BOX; ROPE: TYPE ~ Rope.ROPE; VEC: TYPE ~ Vector.VEC; CompoundBoxProc: TYPE ~ MathRules.CompoundBoxProc; CompositionProc: TYPE ~ MathRules.CompositionProc; Alignment2D: TYPE ~ MathRules.Alignment2D; Offset: TYPE ~ MathRules.Offset; Size: TYPE ~ MathRules.Size; Argument: TYPE ~ MathExpr.Argument; Symbol: TYPE ~ MathExpr.Symbol; CompoundClass: TYPE ~ MathExpr.CompoundClass; FormatClass: TYPE ~ MathTypes.FormatClass; Style: TYPE ~ MathTypes.Style; MakeArgument: PROC[name: ATOM, aliases: LIST OF ATOM, size: Size] RETURNS[Argument] ~ MathExpr.MakeArgument; MakeSymbol: PROC[name: ATOM, aliases: LIST OF ATOM, size: Size, value: EXPR] RETURNS[Symbol] ~ MathExpr.MakeSymbol; MakeCompoundClass: PROC[name: ATOM, formatClass: FormatClass, description: ROPE, args: LIST OF Argument, syms: LIST OF Symbol, boxRule: CompoundBoxProc, compBox: CompositionProc, cvtAS, cvtReduce, cvtSMP, cvtOther: ROPE _ NIL] RETURNS[CompoundClass] ~ MathExpr.MakeCompoundClass; smallGap: REAL = 0.05; medGap: REAL = 0.10; bigGap: REAL = 0.25; SquareBoxRule: CompoundBoxProc ~ { leftSquareBox: BOX _ MathBox.GetBox[$leftSquare, boxes]; rightSquareBox: BOX _ MathBox.GetBox[$rightSquare, boxes]; aBox: BOX _ MathBox.GetBox[$a, boxes]; scaleFactor: REAL _ MAX[0.25, 1.1 * aBox.Height[] / leftSquareBox.Height[]]; leftSquareBox _ MathBox.Scale[leftSquareBox, [scaleFactor, scaleFactor]]; rightSquareBox _ MathBox.Scale[rightSquareBox, [scaleFactor, scaleFactor]]; RETURN[LIST[aBox, leftSquareBox, rightSquareBox]]; }; SquareCompRule: CompositionProc ~ { tempBox: BOX; tempBoxes: LIST OF BOX; alignments: LIST OF Alignment2D _ LIST[ [$leftSquare, [$a, [right], [left]], [$a, [center], [center]]], [$rightSquare, [$a, [left], [right]], [$a, [center], [center]]]]; [tempBox, tempBoxes] _ MathRules.Compose[boxes, alignments, [$leftSquare, [origin]], [$self, [center, -0.25]]]; RETURN[tempBox, tempBoxes]; }; wrongBoxType: PUBLIC ERROR = CODE; InstallListClassesAA: PROC [] ~ { quoteClass: CompoundClass; aSquareArg: Argument; leftQuoteSym, rightQuoteSym: Symbol; aSquareArg _ MakeArgument[$a, LIST[$aliasA, $aliasHot], normal]; leftQuoteSym _ MakeSymbol[$leftSquare, NIL, normal, MathConstructors.MakePlainRope["///"] ]; rightQuoteSym _ MakeSymbol[$rightSquare, NIL, normal, MathConstructors.MakePlainRope["///"] ]; quoteClass _ MakeCompoundClass[$quote, paren, "' a", LIST[aSquareArg], LIST[leftQuoteSym, rightQuoteSym], SquareBoxRule, SquareCompRule, "quote($a)"]; MathDB.KillCompoundClass[$quote]; MathDB.InstallCompoundClass[quoteClass]; MathDB.AddOperator[quoteClass, $List]; }; InstallListClassesAA[]; END. FChangeQuote.mesa Arnon, July 16, 1987 4:08:36 pm PDT Type Abbreviations from Imported Interfaces Procedure Abbreviations from Imported Interfaces Constants Box Procs for Compound Expr Classes effects: Sizes boxes for expr of form ($square $a) right and left square brackets must be as tall as expression "a" Composition Procs for Compound Expr Classes effects: Composes layout for expr of form ($square $a) with symbols $leftSquare and $rightSquare Signals & Errors Define & Install Expression Classes local declarations Install Classes Defined in this Module Κξ˜šœ™Icode™#—J˜šΟk ˜ Kšœ ˜ Kšœ ˜ K˜K˜ K˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜—J˜šΟn œœœ˜šœ˜&Jšœ˜—Jšœ˜J˜Jš˜—J˜headšž+™+Jšœœ œ˜Jšœœ œ˜Jšœœœ˜Jšœœ œ˜Jšœœ˜2Jšœœ˜2Jšœ œ˜*Jšœœ˜ Jšœœ˜J˜Jšœ œ˜#Jšœœ˜Jšœœ˜-Jšœ œ˜*Jšœœ˜—šž0™0Jšž œœœ œœœœ#˜lJ˜Jšž œœœ œœœœœ˜sJ˜Jšžœœœ)œœœœœaœœœ-˜——šž ™ Jšœ œ˜Jšœœ˜Jšœœ˜—šž#™#šž œ˜"Kšœ3™3K™Kšœœ&˜8Kšœœ'˜:Kšœœ˜&K˜Kšœ@™@Kšœ œœ5˜LKšœI˜IKšœK˜KK˜Kšœœ'˜2K˜K˜——šž+™+šžœ˜#KšœE™EKšœ&™&K˜Kšœ œ˜ Kšœ œœœ˜šœ œœœ˜'šœ˜K˜K˜—šœ˜K˜K˜K˜——Kšœp˜pK˜Kšœ˜K˜K˜——šž™Kšœœœœ˜"—šž$™$šžœœ˜!K˜Kšœ™Kšœ˜Kšœ˜Kšœ%˜%K˜Kšœœ˜@KšœEž œ ˜\KšœGž œ ˜^K˜Kšœ5œœL˜—K˜Kšœžœ ˜!Kšœ(˜(Kšœ&˜&K˜K˜K˜——šž&™&K˜—K˜šœ˜K˜—J˜J˜J˜—…— .b