aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interp/ChangeLog7
-rw-r--r--src/interp/i-output.boot.pamphlet15
2 files changed, 16 insertions, 6 deletions
diff --git a/src/interp/ChangeLog b/src/interp/ChangeLog
index 2079573a..1ef84715 100644
--- a/src/interp/ChangeLog
+++ b/src/interp/ChangeLog
@@ -1,5 +1,12 @@
2007-09-24 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * i-output.boot.pamphlet (half): New macro.
+ (bigopAppAux): Use it.
+ (charyTop): Likewise.
+ (binomApp): Likewise.
+
+2007-09-24 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* bookvol5.pamphlet (restart): Simplify. Handle command line
arguments.
diff --git a/src/interp/i-output.boot.pamphlet b/src/interp/i-output.boot.pamphlet
index f28b0af0..c671ac53 100644
--- a/src/interp/i-output.boot.pamphlet
+++ b/src/interp/i-output.boot.pamphlet
@@ -1177,6 +1177,9 @@ bigopWidth(bot,top,arg,kind) ==
kindWidth := (kind = 'pi => 5; 3)
MAX(kindWidth,WIDTH bot,(top => WIDTH top; 0)) + 2 + WIDTH arg
+half x ==>
+ QUOTIENT(x, 2)
+
bigopAppAux(bot,top,arg,x,y,d,kind) ==
botWidth := (bot => WIDTH bot; 0)
topWidth := WIDTH top
@@ -1184,15 +1187,15 @@ bigopAppAux(bot,top,arg,x,y,d,kind) ==
kind = 'pi => 5
3
maxWidth := MAX(opWidth,botWidth,topWidth)
- xCenter := (maxWidth-1)/ 2 + x
+ xCenter := half(maxWidth-1) + x
d:=APP(arg,x+2+maxWidth,y,d)
d:=
atom bot and SIZE atom2String bot = 1 => APP(bot,xCenter,y-2,d)
- APP(bot,x + (maxWidth - botWidth)/2,y-2-superspan bot,d)
+ APP(bot,x + half(maxWidth - botWidth),y-2-superspan bot,d)
if top then
d:=
atom top and SIZE atom2String top = 1 => APP(top,xCenter,y+2,d)
- APP(top,x + (maxWidth - topWidth)/2,y+2+subspan top,d)
+ APP(top,x + half(maxWidth - topWidth),y+2+subspan top,d)
delta := (kind = 'pi => 2; 1)
opCode :=
kind = 'sigma =>
@@ -1540,7 +1543,7 @@ charyTop(u,start,linelength) ==
u is ['CENTER,a] =>
b := charyTopWidth a
(w := WIDTH(b)) > linelength-start => charyTop(a,start,linelength)
- charyTop(b,(linelength-start-w)/2,linelength)
+ charyTop(b,half(linelength-start-w),linelength)
v := charyTopWidth u
EQ(keyp u,'ELSE) => charyElse(u,v,start,linelength)
WIDTH(v) > linelength => charyTrouble(u,v,start,linelength)
@@ -2292,8 +2295,8 @@ binomApp(u,x,y,d) ==
wden := WIDTH den
wnum := WIDTH num
w := MAX(wden,wnum)
- d := APP(den,x+1+(w - wden)/2,ysub,d)
- d := APP(num,x+1+(w - wnum)/2,ysup,d)
+ d := APP(den,x+1+ half(w - wden),ysub,d)
+ d := APP(num,x+1+ half(w - wnum),ysup,d)
hnum := height num
hden := height den
w := 1 + w