aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boot/tokens.boot1
-rw-r--r--src/interp/br-saturn.boot2
-rw-r--r--src/interp/c-doc.boot50
-rw-r--r--src/interp/guess.boot2
-rw-r--r--src/interp/i-funsel.boot2
-rw-r--r--src/interp/newfort.boot2
-rw-r--r--src/interp/sfsfun.boot36
-rw-r--r--src/interp/vmlisp.lisp3
-rw-r--r--src/interp/wi2.boot2
-rw-r--r--src/interp/word.boot2
10 files changed, 50 insertions, 52 deletions
diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot
index a44678b6..a9b603ba 100644
--- a/src/boot/tokens.boot
+++ b/src/boot/tokens.boot
@@ -243,6 +243,7 @@ for i in [ _
repeat property(first i,'SHOETHETA) := rest i
for i in [ _
+ ["abs", "ABS"], _
["alphabetic?", "ALPHA-CHAR-P"], _
["and", "AND"] , _
["append", "APPEND"] , _
diff --git a/src/interp/br-saturn.boot b/src/interp/br-saturn.boot
index 4b7f17c1..e40099e2 100644
--- a/src/interp/br-saturn.boot
+++ b/src/interp/br-saturn.boot
@@ -1406,7 +1406,7 @@ htSaySourceFile conname ==
htSayIndentRel(n,:options) ==
flag := IFCAR options
- m := ABSVAL n
+ m := abs n
if flag then m := m + 2
if $standard then htSayStandard
n > 0 =>
diff --git a/src/interp/c-doc.boot b/src/interp/c-doc.boot
index 12ec3898..2208da20 100644
--- a/src/interp/c-doc.boot
+++ b/src/interp/c-doc.boot
@@ -301,11 +301,11 @@ checkRewrite(name,lines) == main where --similar to checkComments from c-doc
for x in u repeat
w := newString2Words x
verbatim =>
- w and first w = '"\end{verbatim}" =>
+ w and first w is '"\end{verbatim}" =>
verbatim := false
u2 := append(u2, w)
u2 := append(u2, [x])
- w and first w = '"\begin{verbatim}" =>
+ w and first w is '"\begin{verbatim}" =>
verbatim := true
u2 := append(u2, w)
u2 := append(u2, w)
@@ -327,7 +327,7 @@ checkTexht u ==
acc := nil
while u repeat
x := first u
- if x = '"\texht" and (u := IFCDR u) then
+ if x is '"\texht" and (u := IFCDR u) then
if not (IFCAR u = $charLbrace) then
checkDocError '"First left brace after \texht missing"
count := 1 -- drop first argument including braces of \texht
@@ -335,7 +335,7 @@ checkTexht u ==
if y = $charLbrace then count := count + 1
if y = $charRbrace then count := count - 1
x := IFCAR (u := rest u) -- drop first right brace of 1st arg
- if x = '"\httex" and (u := IFCDR u) and (IFCAR u = $charLbrace) then
+ if x is '"\httex" and (u := IFCDR u) and (IFCAR u = $charLbrace) then
acc := [IFCAR u,:acc] --left brace: add it
while (y := IFCAR (u := rest u)) ~= $charRbrace repeat (acc := [y,:acc])
acc := [IFCAR u,:acc] --right brace: add it
@@ -373,19 +373,19 @@ checkRecordHash u ==
htname := intern checkGetStringBeforeRightBrace u
entry := HGET($glossHash,htname) or [nil]
HPUT($glossHash,htname,[first entry,:[[$name,:$origin],:rest entry]])
- else if x = '"\spadsys" and (u := checkLookForLeftBrace IFCDR u) and (u := IFCDR u) then
+ else if x is '"\spadsys" and (u := checkLookForLeftBrace IFCDR u) and (u := IFCDR u) then
s := checkGetStringBeforeRightBrace u
if s.0 = char '_) then s := SUBSTRING(s,1,nil)
parse := checkGetParse s
null parse => checkDocError ['"Unparseable \spadtype: ",s]
not member(opOf parse,$currentSysList) =>
checkDocError ['"Bad system command: ",s]
- atom parse or not (parse is ['set,arg]) => 'ok ---assume ok
+ atom parse or (parse isnt ['set,arg]) => 'ok ---assume ok
not spadSysChoose($setOptions,arg) =>
checkDocError ['"Incorrect \spadsys: ",s]
entry := HGET($sysHash,htname) or [nil]
HPUT($sysHash,htname,[first entry,:[[$name,:$origin],:rest entry]])
- else if x = '"\spadtype" and (u := checkLookForLeftBrace IFCDR u) and (u := IFCDR u) then
+ else if x is '"\spadtype" and (u := checkLookForLeftBrace IFCDR u) and (u := IFCDR u) then
s := checkGetStringBeforeRightBrace u
parse := checkGetParse s
null parse => checkDocError ['"Unparseable \spadtype: ",s]
@@ -548,11 +548,11 @@ checkAddMacros u ==
while u repeat
x := first u
acc :=
- x = '"\end{verbatim}" =>
+ x is '"\end{verbatim}" =>
verbatim := false
[x, :acc]
verbatim => [x, :acc]
- x = '"\begin{verbatim}" =>
+ x is '"\begin{verbatim}" =>
verbatim := true
[x, :acc]
y := LASSOC(x,$HTmacs) => [:y,:acc]
@@ -574,11 +574,11 @@ checkComments(nameSig,lines) == main where
for x in u repeat
w := newString2Words x
verbatim =>
- w and first w = '"\end{verbatim}" =>
+ w and first w is '"\end{verbatim}" =>
verbatim := false
u2 := append(u2, w)
u2 := append(u2, [x])
- w and first w = '"\begin{verbatim}" =>
+ w and first w is '"\begin{verbatim}" =>
verbatim := true
u2 := append(u2, w)
u2 := append(u2, w)
@@ -867,14 +867,14 @@ checkAddSpaces u ==
-- since this might be written to a file, we can't really use
-- newline characters. The Browser and HD will do the translation
-- later.
- if f = '"\begin{verbatim}" then
+ if f is '"\begin{verbatim}" then
space := $charFauxNewline
if null u2 then u2 := [space]
if i > 1 then u2 := [:u2, space, f]
else u2 := [:u2, f]
- if f = '"\end{verbatim}" then
+ if f is '"\end{verbatim}" then
u2 := [:u2, space]
space := $charBlank
u2
@@ -885,11 +885,11 @@ checkIeEg u ==
while u repeat
x := first u
acc :=
- x = '"\end{verbatim}" =>
+ x is '"\end{verbatim}" =>
verbatim := false
[x, :acc]
verbatim => [x, :acc]
- x = '"\begin{verbatim}" =>
+ x is '"\begin{verbatim}" =>
verbatim := true
[x, :acc]
z := checkIeEgfun x => [:nreverse z,:acc]
@@ -899,7 +899,7 @@ checkIeEg u ==
checkIeEgfun x ==
CHARP x => nil
- x = '"" => nil
+ x is '"" => nil
m := MAXINDEX x
for k in 0..(m - 3) repeat
x.(k + 1) = $charPeriod and x.(k + 3) = $charPeriod and
@@ -915,11 +915,11 @@ checkSplit2Words u ==
while u repeat
x := first u
acc :=
- x = '"\end{verbatim}" =>
+ x is '"\end{verbatim}" =>
verbatim := false
[x, :acc]
verbatim => [x, :acc]
- x = '"\begin{verbatim}" =>
+ x is '"\begin{verbatim}" =>
verbatim := true
[x, :acc]
z := checkSplitBrace x => [:nreverse z,:acc]
@@ -956,7 +956,7 @@ checkSplitBackslash x ==
[x]
checkSplitPunctuation x ==
- CHARP x => [x]
+ not string? x => [x]
m := MAXINDEX x
m < 1 => [x]
lastchar := x.m
@@ -982,7 +982,7 @@ checkSplitPunctuation x ==
[x]
checkSplitOn(x) ==
- CHARP x => [x]
+ not string? x => [x]
l := $charSplitList
m := MAXINDEX x
while l repeat
@@ -1041,21 +1041,21 @@ checkBeginEnd u ==
(substring?('"\radiobox",x,0) or substring?('"\inputbox",x,0))=>
--allow 0 argument guys to pass through
checkDocError ["Unexpected HT command: ",x]
- x = '"\beginitems" =>
+ x is '"\beginitems" =>
beginEndStack := ["items",:beginEndStack]
- x = '"\begin" =>
+ x is '"\begin" =>
u is [.,=$charLbrace,y,:r] and first r = $charRbrace =>
if not member(y,$beginEndList) then
checkDocError ['"Unknown begin type: \begin{",y,'"}"]
beginEndStack := [y,:beginEndStack]
u := r
checkDocError ['"Improper \begin command"]
- x = '"\item" =>
+ x is '"\item" =>
member(IFCAR beginEndStack,'("items" "menu")) => nil
null beginEndStack =>
checkDocError ['"\item appears outside a \begin-\end"]
checkDocError ['"\item appears within a \begin{",IFCAR beginEndStack,'"}.."]
- x = '"\end" =>
+ x is '"\end" =>
u is [.,=$charLbrace,y,:r] and first r = $charRbrace =>
y = IFCAR beginEndStack =>
beginEndStack := rest beginEndStack
@@ -1109,7 +1109,7 @@ checkLookForRightBrace(u) == --return line beginning with right brace
checkInteger s ==
CHARP s => false
s = '"" => false
- and/[DIGIT_-CHAR_-P s.i for i in 0..MAXINDEX s]
+ and/[digit? s.i for i in 0..MAXINDEX s]
checkTransformFirsts(opname,u,margin) ==
--case 1: \spad{...
diff --git a/src/interp/guess.boot b/src/interp/guess.boot
index 2947b34c..b7d2e000 100644
--- a/src/interp/guess.boot
+++ b/src/interp/guess.boot
@@ -277,7 +277,7 @@ deltaWordEntry(word,entry) ==
word = entry => 0
word.0 ~= entry.0 => 1000
#word > 2 and stringPrefix?(word,entry) => 1
- ABS(diff := # word - # entry) > 4 => 1000
+ abs(diff := # word - # entry) > 4 => 1000
canForgeWord(word,entry)
--+ Note these are optimized definitions below-- see commented out versions
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index 166ab44b..bdb13805 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -755,7 +755,7 @@ selectMostGeneralMm mmList ==
while mml repeat
[mm,:mml] := mml
sz := #first mm
- if (met := ABS(sz - 3)) < min then
+ if (met := abs(sz - 3)) < min then
min := met
fsz := sz
mmList := [mm for mm in mmList | (#first mm) = fsz]
diff --git a/src/interp/newfort.boot b/src/interp/newfort.boot
index e5940afa..c6b7590c 100644
--- a/src/interp/newfort.boot
+++ b/src/interp/newfort.boot
@@ -803,7 +803,7 @@ fortPre1 e ==
[rand,exponent] := args
rand = "%e" => fortPre1 ["exp", exponent]
(IDENTP rand or string? rand) and exponent=2 => ["*", rand, rand]
- (FIXP exponent and ABS(exponent) < 32768) => ["**",fortPre1 rand,exponent]
+ (FIXP exponent and abs(exponent) < 32768) => ["**",fortPre1 rand,exponent]
["**", fortPre1 rand,fortPre1 exponent]
op = "ROOT" =>
#args = 1 => fortPreRoot ["sqrt", first args]
diff --git a/src/interp/sfsfun.boot b/src/interp/sfsfun.boot
index 5424f565..3f58d1ea 100644
--- a/src/interp/sfsfun.boot
+++ b/src/interp/sfsfun.boot
@@ -197,7 +197,7 @@ gammaRatkernel(x) ==
-- cgammat is auxiliary "t" function (see p. 263 Kuki)
cgammat(x) ==
- MAX(0.1, MIN(10.0, 10.0*SQRT(2.0) - ABS(x)))
+ MAX(0.1, MIN(10.0, 10.0*SQRT(2.0) - abs(x)))
cgamma (z) ==
z2 := IMAGPART(z)
@@ -372,7 +372,7 @@ rPsiW(n,x) ==
then
a := MIN(0,1.0/float(n)*LOG($DoubleFloatPrecision/MIN(1.0,x)))
c := EXP(a)
- if ABS(a) >= 0.001
+ if abs(a) >= 0.001
then
fln := x/c*(1.0-c)
else
@@ -475,11 +475,11 @@ cPsi(n,z) ==
return COMPLEX(REALPART(conjresult),-IMAGPART(conjresult))
nterms := 22
bound := 10.0
- if x<0.0 --- and ABS(z)>bound and ABS(y)<bound
+ if x<0.0 --- and abs(z)>bound and abs(y)<bound
then
FloatError('"Psi implementation can't compute at ~S ",[n,z])
--- return cpsireflect(n,x,y,z)
- else if (x>0.0 and ABS(z)>bound ) --- or (x<0.0 and ABS(y)>bound)
+ else if (x>0.0 and abs(z)>bound ) --- or (x<0.0 and abs(y)>bound)
then
return PsiXotic(n,PsiAsymptotic(n,z))
else --- use recursion formula
@@ -509,7 +509,7 @@ chebf01 (c,z) ==
--- indexed from 0 to n+1.
--- See Luke's books for further explanation
n := 75 --- ad hoc decision
---- if ABS(z)/ABS(c) > 200.0 and ABS(z)>10000.0
+--- if abs(z)/abs(c) > 200.0 and abs(z)>10000.0
--- then
--- FloatError('"cheb0F1 not implemented for ~S < 1",[c,z])
w := 2.0*z
@@ -577,7 +577,7 @@ f01(c,z)==
then
FloatError('"0F1 not defined for negative integer parameter value ~S",c)
-- conditions when we'll permit the computation
- else if ABS(c)<1000.0 and ABS(z)<1000.0
+ else if abs(c)<1000.0 and abs(z)<1000.0
then
brutef01(c,z)
else if ZEROP IMAGPART(z) and ZEROP IMAGPART(c) and z>=0.0 and c>=0.0
@@ -587,13 +587,13 @@ f01(c,z)==
--- t := SQRT(-z)
--- c1 := c-1.0
--- p := PHASE(c)
---- if ABS(c)>10.0*ABS(t) and p>=0.0 and PHASE(c)<.90*PI
+--- if abs(c)>10.0*abs(t) and p>=0.0 and PHASE(c)<.90*PI
--- then BesselJAsymptOrder(c1,2*t)*cgamma(c/(t**(c1)))
---- else if ABS(t)>10.0*ABS(c) and ABS(t)>50.0
+--- else if abs(t)>10.0*abs(c) and abs(t)>50.0
--- then BesselJAsympt(c1,2*t)*cgamma(c/(t**(c1)))
--- else
--- FloatError('"0F1 not implemented for ~S",[c,z])
- else if (10.0*ABS(c)>ABS(z)) and ABS(c)<1.0E4 and ABS(z)<1.0E4
+ else if (10.0*abs(c)>abs(z)) and abs(c)<1.0E4 and abs(z)<1.0E4
then
brutef01(c,z)
else
@@ -740,8 +740,8 @@ BesselJ(v,z) ==
ZEROP IMAGPART(v) and REALPART(v)>=0.0)) => --- zero arg, pos. real order
ZEROP v => 1.0 --- J(0,0)=1
0.0 --- J(v,0)=0 for real v>0
- rv := ABS(v)
- rz := ABS(z)
+ rv := abs(v)
+ rz := abs(z)
(rz>B1) and (rz > B2*rv) => --- asymptotic argument
BesselJAsympt(v,z)
(rv>B1) and (rv > B2*rz) => --- asymptotic order
@@ -765,10 +765,10 @@ BesselJRecur(v,z) ==
--Numerical.Recipes. suggest so:=v+sqrt(n.s.f.^2*v)
so:=15.0*z
-- reduce order until non-zero
- while ZEROP ABS(BesselJAsymptOrder(so,z)) repeat so:=so/2.0
- if ABS(so)<ABS(z) then so:=v+18.*SQRT(v)
- m:= FLOOR(ABS(so-v))+1
- w:=MAKE_-ARRAY(m)
+ while ZEROP abs(BesselJAsymptOrder(so,z)) repeat so:=so/2.0
+ if abs(so)<abs(z) then so:=v+18.*SQRT(v)
+ m:= FLOOR(abs(so-v))+1
+ w := newVector m
SETF(AREF(w,m-1),BesselJAsymptOrder(v+m-1,z))
SETF(AREF(w,m-2),BesselJAsymptOrder(v+m-2,z))
for i in m-3 .. 0 by -1 repeat
@@ -789,9 +789,9 @@ BesselI(v,z) ==
REALPART(v)<0.0 and not ZEROP IMAGPART(v) and FLOATP(z) =>
CONJUGATE(BesselI(CONJUGATE(v),z))
---We now know that Re(z)>= 0.0
- ABS(z) > B1 => --- asymptotic argument case
+ abs(z) > B1 => --- asymptotic argument case
FloatError('"BesselI not implemented for ~S",[v,z])
- ABS(v) > B1 =>
+ abs(v) > B1 =>
FloatError('"BesselI not implemented for ~S",[v,z])
--- case of small argument and order
REALPART(v)>= 0.0 => besselIback(v,z)
@@ -917,7 +917,7 @@ BesselIAsympt(v,z,n) ==
term1 := -term1 *(fourvsq-(two*float(r)-1.0)**2)/_
(float(r)*eight*z)
sum1 := sum1 + term1
- sum2 := sum2 + ABS(term1)
+ sum2 := sum2 + abs(term1)
sqrttwopiz := SQRT(two*PI*z)
EXP(z)/sqrttwopiz*(1.0 + sum1 ) +_
EXP(-(float(n)+.5)*PI*i)*EXP(-z)/sqrttwopiz*(1.0+ sum2)
diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp
index 3729558f..4f213b69 100644
--- a/src/interp/vmlisp.lisp
+++ b/src/interp/vmlisp.lisp
@@ -67,9 +67,6 @@
;; DEFMACROS
-(defmacro absval (x)
- `(abs ,x))
-
(defmacro add1 (x)
`(1+ ,x))
diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot
index eb0e2370..6641599a 100644
--- a/src/interp/wi2.boot
+++ b/src/interp/wi2.boot
@@ -833,7 +833,7 @@ smallIntegerStep(it,index,start,inc,optFinal,e) ==
null (inc':= comp(inc,$SmallInteger,start'.env)) => nil
if optFinal is [final] and not (final':= comp(final,$SmallInteger,inc'.env)) then
-- not (FIXP startNum and FIXP incNum) => return nil
--- null FIXP startNum or ABSVAL startNum > 100 => return nil
+-- null FIXP startNum or abs startNum > 100 => return nil
-----> assume that optFinal is $SmallInteger
T := comp(final,$EmptyMode,inc'.env) or return nil
final' := T
diff --git a/src/interp/word.boot b/src/interp/word.boot
index eb7e9c3d..16e26324 100644
--- a/src/interp/word.boot
+++ b/src/interp/word.boot
@@ -286,7 +286,7 @@ guessFromList(key,stringList) ==
deltaWordEntry(word,entry) ==
word = entry => 0
- ABS(diff := # word - # entry) > 4 => 1000
+ abs(diff := # word - # entry) > 4 => 1000
canForgeWord(word,entry)
--+ Note these are optimized definitions below-- see commented out versions