aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog17
-rw-r--r--src/interp/buildom.boot2
-rw-r--r--src/interp/g-timer.boot4
-rw-r--r--src/interp/g-util.boot2
-rw-r--r--src/interp/htsetvar.boot2
-rw-r--r--src/interp/i-output.boot24
-rw-r--r--src/interp/incl.boot14
-rw-r--r--src/interp/msgdb.boot12
-rw-r--r--src/interp/nrungo.boot12
-rw-r--r--src/interp/nrunopt.boot6
-rw-r--r--src/interp/pspad1.boot2
-rw-r--r--src/interp/topics.boot2
-rw-r--r--src/interp/vmlisp.lisp5
13 files changed, 58 insertions, 46 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 94060372..5055d842 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,22 @@
2010-07-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/spad.lisp (DIVIDE2): Remove.
+ * interp/vmlisp.lisp (QSQUOTIENT): Likewise.
+ (QSREMAINDER): Likewise.
+ * interp/buildom.boot: Use quo and rem in leur of QUOTIENT and
+ REMAINDER or variants.
+ * interp/g-timer.boot: Likewise.
+ * interp/g-util.boot: Likewise.
+ * interp/htsetvar.boot: Likewise.
+ * interp/i-output.boot: Likewise.
+ * interp/incl.boot: Likewise.
+ * interp/msgdb.boot: Likewise.
+ * interp/nrungo.boot: Likewise.
+ * interp/pspad1.boot: Likewise.
+ * interp/topics.boot: Likewise.
+
+2010-07-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/sys-globals.boot ($VariableCount): Remove.
* interp/spad.lisp (QUOTIENT2): Remove.
(REMAINDER2): Likewise.
diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot
index 73e007ae..1488064b 100644
--- a/src/interp/buildom.boot
+++ b/src/interp/buildom.boot
@@ -240,7 +240,7 @@ MappingPrint(x, dom) == coerceMap2E(x)
coerceMap2E(x) ==
-- nrlib domain
ARRAYP rest x => ["theMap", BPINAME first x,
- if $testingSystem then 0 else REMAINDER(HASHEQ rest x, 1000)]
+ if $testingSystem then 0 else HASHEQ(rest x) rem 1000]
-- aldor
["theMap", BPINAME first x ]
diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot
index 9f1fd02f..9de4e082 100644
--- a/src/interp/g-timer.boot
+++ b/src/interp/g-timer.boot
@@ -102,8 +102,8 @@ normalizeStatAndStringify t ==
integer? t =>
K := 1024
M := K*K
- t > 9*M => strconc(STRINGIMAGE QUOTIENT(t + 512*K,M), '"M")
- t > 9*K => strconc(STRINGIMAGE QUOTIENT(t + 512,K), '"K")
+ t > 9*M => strconc(STRINGIMAGE((t + 512*K) quo M), '"M")
+ t > 9*K => strconc(STRINGIMAGE((t + 512) quo K), '"K")
STRINGIMAGE t
STRINGIMAGE t
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index b408d077..d9145d47 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -1069,7 +1069,7 @@ mergeSort(f,g,p,n) ==
t.rest := NIL
if QSLESSP(n,3) then return p
-- split the list p into p and q of equal length
- l := QSQUOTIENT(n,2)
+ l := n quo 2
t := p
for i in 1..l-1 repeat t := rest t
q := rest t
diff --git a/src/interp/htsetvar.boot b/src/interp/htsetvar.boot
index 8a768ebe..5dd805bb 100644
--- a/src/interp/htsetvar.boot
+++ b/src/interp/htsetvar.boot
@@ -60,7 +60,7 @@ htShowSetTree(setTree) ==
maxWidth2 := MAX(41,maxWidth2)
tabset1 := STRINGIMAGE (maxWidth1)
tabset2 := STRINGIMAGE (maxWidth2 + maxWidth1 - 1)
- htSay('"\tab{2}\newline Variable\tab{",STRINGIMAGE (maxWidth1 + QUOTIENT(maxWidth2,3)),'"}Description\tab{",STRINGIMAGE(maxWidth2 + maxWidth1 + 2),'"}Value\newline\beginitems ")
+ htSay('"\tab{2}\newline Variable\tab{",STRINGIMAGE (maxWidth1 + (maxWidth2 quo 3)),'"}Description\tab{",STRINGIMAGE(maxWidth2 + maxWidth1 + 2),'"}Value\newline\beginitems ")
for setData in reverse okList repeat
htSay '"\item"
label := strconc('"\menuitemstyle{",setData.setName,'"}")
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index 7484e2dd..c9f35dc5 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -1318,7 +1318,7 @@ bigopWidth(bot,top,arg,kind) ==
MAX(kindWidth,WIDTH bot,(top => WIDTH top; 0)) + 2 + WIDTH arg
half x ==>
- QUOTIENT(x, 2)
+ x quo 2
bigopAppAux(bot,top,arg,x,y,d,kind) ==
botWidth := (bot => WIDTH bot; 0)
@@ -1404,7 +1404,7 @@ overlabelWidth [.,a,b] == WIDTH b
overlabelApp([.,a,b], x, y, d) ==
underApp:= APP(b,x,y,d)
endPoint := x + WIDTH b - 1
- middle := QUOTIENT(x + endPoint,2)
+ middle := (x + endPoint) quo 2
h := y + superspan b + 1
d := APP(a,middle,h + 1,d)
apphor(x,x+WIDTH b-1,y+superspan b+1,d,"|")
@@ -2051,12 +2051,12 @@ appfrac(u, x, y, d) ==
-- not possible, expressions are offset to the right rather than left.
-- MCD 16-8-95
w := WIDTH u
- tempx := x + QUOTIENT(1+w - WIDTH second rest u, 2)
+ tempx := x + (1+w - WIDTH second rest u) quo 2
tempy := y - superspan second rest u - 1
temparg3 := APP(second rest u, tempx, tempy, d)
temparg4 := apphor(x, x + w - 1, y, temparg3,specialChar('hbar))
APP(second u,
- x + QUOTIENT(1+w - WIDTH second u, 2),
+ x + (1+w - WIDTH second u) quo 2,
y + 1 + subspan second u,
temparg4)
@@ -2192,10 +2192,10 @@ nothingApp(u, x, y, d) ==
zagApp(u, x, y, d) ==
w := WIDTH u
- denx := x + QUOTIENT(w - WIDTH second rest u, 2)
+ denx := x + (w - WIDTH second rest u) quo 2
deny := y - superspan second rest u - 1
d := APP(second rest u, denx, deny, d)
- numx := x + QUOTIENT(w - WIDTH second u, 2)
+ numx := x + (w - WIDTH second u) quo 2
numy := y+1 + subspan second u
d := APP(second u, numx, numy, d)
a := 1 + zagSuper u
@@ -2263,7 +2263,7 @@ appmat(u, x, y, d) ==
rows := rest rows
return(flag := '"ON"; nil)
d := APP(first row,
- xc + QUOTIENT(first w - WIDTH first row, 2),
+ xc + (first w - WIDTH first row) quo 2,
yc,
d)
xc := xc + 2 + first w
@@ -2271,11 +2271,11 @@ appmat(u, x, y, d) ==
w := rest w
matSuper(x) ==
- (x := x.1) => -1 + QUOTIENT(first x.1 + first x.2, 2)
+ (x := x.1) => -1 + (first x.1 + first x.2) quo 2
true => ERROR('MAT)
matSub(x) ==
- (x := x.1) => QUOTIENT(-1 + first x.1 + first x.2, 2)
+ (x := x.1) => (-1 + first x.1 + first x.2) quo 2
true => ERROR('MAT)
matWidth(x) ==
@@ -2522,7 +2522,7 @@ vconcatapp(u, x, y, d) ==
y := y + superspan u.1 + 1
for a in rest u repeat
y := y - superspan a - 1
- xoff := QUOTIENT(w - WIDTH a, 2)
+ xoff := (w - WIDTH a) quo 2
d := APP(a, x + xoff, y, d)
y := y - subspan a
d
@@ -2533,10 +2533,10 @@ binomialApp(u, x, y, d) ==
d := APP('"(",x,y,d)
x := x + 1
y1 := y - height a
- xoff := QUOTIENT(w - WIDTH a, 2)
+ xoff := (w - WIDTH a) quo 2
d := APP(a, x + xoff, y1, d)
y2 := y + height b
- xoff := QUOTIENT(w - WIDTH b, 2)
+ xoff := (w - WIDTH b) quo 2
d := APP(b, x + xoff, y2, d)
x := x + w
APP('")",x,y,d)
diff --git a/src/interp/incl.boot b/src/interp/incl.boot
index 538ed37f..fbfdec71 100644
--- a/src/interp/incl.boot
+++ b/src/interp/incl.boot
@@ -53,13 +53,13 @@ ElseifSkipPart == 22
ElseSkipToEnd == 30
ElseKeepPart == 31
-Top? (st) == QUOTIENT(st,10) = 0
-If? (st) == QUOTIENT(st,10) = 1
-Elseif? (st) == QUOTIENT(st,10) = 2
-Else? (st) == QUOTIENT(st,10) = 3
-SkipEnd? (st) == REMAINDER(st,10) = 0
-KeepPart?(st) == REMAINDER(st,10) = 1
-SkipPart?(st) == REMAINDER(st,10) = 2
+Top? (st) == st quo 10 = 0
+If? (st) == st quo 10 = 1
+Elseif? (st) == st quo 10 = 2
+Else? (st) == st quo 10 = 3
+SkipEnd? (st) == st rem 10 = 0
+KeepPart?(st) == st rem 10 = 1
+SkipPart?(st) == st rem 10 = 2
Skipping?(st) == not KeepPart? st
incStringStream s==
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index 7a646ce5..4d26fe71 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -864,17 +864,17 @@ sayAsManyPerLineAsPossible l ==
NIL
w := MIN(m + 3,$LINELENGTH)
-- p is the number of elements per line
- p := QUOTIENT($LINELENGTH,w)
+ p := $LINELENGTH quo w
n := # l
str := '""
for i in 0..(n-1) repeat
[c,:l] := l
str := strconc(str,c,fillerSpaces(w - #c,'" "))
- REMAINDER(i+1,p) = 0 => (sayMSG str ; str := '"" )
+ (i+1) rem p = 0 => (sayMSG str ; str := '"" )
if str ~= '"" then sayMSG str
NIL
-say2PerLine l == say2PerLineWidth(l, QUOTIENT($LINELENGTH,2))
+say2PerLine l == say2PerLineWidth(l, $LINELENGTH quo 2)
say2PerLineWidth(l,n) ==
[short,long] := say2Split(l,nil,nil,n)
@@ -907,7 +907,7 @@ say2PerLineThatFit l ==
while l repeat
sayBrightlyNT first l
sayBrightlyNT
- fillerSpaces((QUOTIENT($LINELENGTH,2)-sayDisplayWidth first l),'" ")
+ fillerSpaces(($LINELENGTH quo 2 - sayDisplayWidth first l),'" ")
(l:= rest l) =>
sayBrightlyNT first l
l:= rest l
@@ -938,7 +938,7 @@ pp2Cols(al) ==
ppPair(abb,name)
if canFit2ndEntry(name,al) then
[[abb,:name],:al]:= al
- TAB QUOTIENT($LINELENGTH,2)
+ TAB($LINELENGTH quo 2)
ppPair(abb,name)
sayNewLine()
nil
@@ -947,7 +947,7 @@ ppPair(abb,name) ==
sayBrightlyNT [:bright abb,fillerSpaces(8-entryWidth abb," "),name]
canFit2ndEntry(name,al) ==
- wid := QUOTIENT($LINELENGTH,2) - 10
+ wid := $LINELENGTH quo 2 - 10
null al => nil
entryWidth name > wid => nil
entryWidth CDAR al > wid => nil
diff --git a/src/interp/nrungo.boot b/src/interp/nrungo.boot
index 4b7b51e9..b2094b83 100644
--- a/src/interp/nrungo.boot
+++ b/src/interp/nrungo.boot
@@ -104,12 +104,12 @@ goGet(:l) ==
[:arglist,env] := l
arglist is ['goGet,:.] => stop()
[[.,[op,initSig,:code]],thisDomain] := env
- domainSlot := QSQUOTIENT(code,8192)
- code1 := QSREMAINDER(code,8192)
+ domainSlot := code quo 8192
+ code1 := code rem 8192
if QSODDP code1 then isConstant := true
- code2 := QSQUOTIENT(code1,2)
+ code2 := code1 quo 2
if QSODDP code2 then explicitLookupDomainIfTrue := true
- index := QSQUOTIENT(code2,2)
+ index := code2 quo 2
kind := (isConstant = true => 'CONST; 'ELT)
sig := [NRTreplaceLocalTypes(s,thisDomain) for s in initSig]
sig := substDomainArgs(thisDomain,sig)
@@ -157,10 +157,10 @@ lookupInTable(op,sig,dollar,[domain,table]) ==
EQSUBSTLIST(rest(domain.0),$FormalMapVariableList,a)
someMatch:=true
false
- predIndex := QSQUOTIENT(code,8192)
+ predIndex := code quo 8192
predIndex ~= 0 and not lookupPred($predVector.predIndex,dollar,domain)
=> false
- loc := QSQUOTIENT(QSREMAINDER(code,8192),2)
+ loc := (code rem 8192) quo 2
loc = 0 =>
someMatch := true
nil
diff --git a/src/interp/nrunopt.boot b/src/interp/nrunopt.boot
index 12b07154..32adc79f 100644
--- a/src/interp/nrunopt.boot
+++ b/src/interp/nrunopt.boot
@@ -345,7 +345,7 @@ testBitVector(vec,i) ==
bitsOf n ==
n = 0 => 0
- 1 + bitsOf QUOTIENT(n,2)
+ 1 + bitsOf(n quo 2)
--=======================================================================
-- Generate Slot 4 Constructor Vectors
@@ -639,7 +639,7 @@ dcData con ==
dcData1 vec ==
n := MAXINDEX vec
- tens := QUOTIENT(n,10)
+ tens := n quo 10
for i in 0..tens repeat
start := 10*i
sayBrightlyNT rightJustifyString(STRINGIMAGE start,6)
@@ -725,7 +725,7 @@ nodeSize(n) == 12 * n
vectorSize(n) == 4 * (1 + n)
halfWordSize(n) ==
- n < 128 => QUOTIENT(n,2)
+ n < 128 => n quo 2
n < 256 => n
2 * n
diff --git a/src/interp/pspad1.boot b/src/interp/pspad1.boot
index 2af4ef75..a4e2e806 100644
--- a/src/interp/pspad1.boot
+++ b/src/interp/pspad1.boot
@@ -178,7 +178,7 @@ consBuffer item ==
$autoLine =>
--is true except within try
formatOutput reverse $lineFragmentBuffer
- $c:= REMAINDER($m+2*($numberOfSpills:= $numberOfSpills+1), $lineLength)
+ $c:= ($m+2*($numberOfSpills:= $numberOfSpills+1)) rem $lineLength
$lineFragmentBuffer:= [nBlanks $c]
consBuffer item
nil
diff --git a/src/interp/topics.boot b/src/interp/topics.boot
index 6310986c..656a7dee 100644
--- a/src/interp/topics.boot
+++ b/src/interp/topics.boot
@@ -221,7 +221,7 @@ topics con ==
code2Classes cc ==
cc := 2*cc
- [x while cc ~= 0 for x in $topicClasses | ODDP (cc := QUOTIENT(cc,2))]
+ [x while cc ~= 0 for x in $topicClasses | ODDP (cc := cc quo 2)]
myLastAtom x ==
while x is [.,:x] repeat nil
diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp
index b63a7094..139701c0 100644
--- a/src/interp/vmlisp.lisp
+++ b/src/interp/vmlisp.lisp
@@ -778,11 +778,6 @@
(multiple-value-list (truncate x y))
(list (QUOTIENT x y) (REMAINDER x y))))
-(defun QSQUOTIENT (a b) (the fixnum (truncate (the fixnum a) (the fixnum b))))
-
-(defun QSREMAINDER (a b) (the fixnum (rem (the fixnum a) (the fixnum b))))
-
-
; 13.3 Updating