aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-12-12 21:25:26 +0000
committerdos-reis <gdr@axiomatics.org>2010-12-12 21:25:26 +0000
commit245f4067091550d9d89bc25b5e2e8c95729354b7 (patch)
treedf82fbfbfe47498d59ac7f7fc9528552aae5d681 /src
parent51828facc9bb3dd130b723cb49b1b5eff04231dd (diff)
downloadopen-axiom-245f4067091550d9d89bc25b5e2e8c95729354b7.tar.gz
Tidy expression matching against strings
Diffstat (limited to 'src')
-rw-r--r--src/interp/as.boot2
-rw-r--r--src/interp/database.boot2
-rw-r--r--src/interp/diagnostics.boot15
-rw-r--r--src/interp/format.boot4
-rw-r--r--src/interp/fortcall.boot2
-rw-r--r--src/interp/i-eval.boot2
-rw-r--r--src/interp/i-funsel.boot4
-rw-r--r--src/interp/i-resolv.boot4
-rw-r--r--src/interp/lisplib.boot2
-rw-r--r--src/interp/msgdb.boot6
10 files changed, 21 insertions, 22 deletions
diff --git a/src/interp/as.boot b/src/interp/as.boot
index 6aa64624..b21ad225 100644
--- a/src/interp/as.boot
+++ b/src/interp/as.boot
@@ -318,7 +318,7 @@ asyExtractDescription str ==
str
trimComments str ==
- null str or str = '"" => '""
+ str = nil or str = '"" => '""
m := MAXINDEX str
str := SUBSTRING(str,0,m)
trimString str
diff --git a/src/interp/database.boot b/src/interp/database.boot
index f7cff26a..00584999 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -430,7 +430,7 @@ modemapPattern(mmPattern,sig) ==
partial := false
for xTails in tails mmPattern repeat
x := first xTails
- if x is ['Union,dom,tag] and tag = '"failed" and xTails=sig then
+ if x is ['Union,dom,'"failed"] and xTails=sig then
x := dom
partial := true
patvar := rassoc(x,patternAlist)
diff --git a/src/interp/diagnostics.boot b/src/interp/diagnostics.boot
index a4cd8dca..d91e3679 100644
--- a/src/interp/diagnostics.boot
+++ b/src/interp/diagnostics.boot
@@ -80,14 +80,13 @@ MESSAGEPRINT x ==
MAPC(function MESSAGEPRINT_-1, x)
MESSAGEPRINT_-1 x ==
- x = "%l" or x = '"%l" => TERPRI()
- string? x => PRINC x
- IDENTP x => PRINC x
- atom x => PRINC x
- PRINC '"("
- MESSAGEPRINT_-1 first x
- MESSAGEPRINT_-2 rest x
- PRINC '")"
+ cons? x =>
+ PRINC '"("
+ MESSAGEPRINT_-1 first x
+ MESSAGEPRINT_-2 rest x
+ PRINC '")"
+ x = "%l" or x is '"%l" => TERPRI()
+ PRINC x
MESSAGEPRINT_-2 x ==
atom x =>
diff --git a/src/interp/format.boot b/src/interp/format.boot
index 90030763..b27d07ec 100644
--- a/src/interp/format.boot
+++ b/src/interp/format.boot
@@ -290,8 +290,8 @@ dollarPercentTran x ==
z1 := dollarPercentTran z
EQ(y, y1) and EQ(z, z1) => x
[y1, :z1]
- x = "$" or x = '"$" => "%%"
- x = "T$" or x = '"T$" => "T"
+ x is "$" or x is '"$" => "%%"
+ x is "T$" or x is '"T$" => "T"
x
formatSignatureAsTeX sig ==
diff --git a/src/interp/fortcall.boot b/src/interp/fortcall.boot
index 7a195749..061e1bb1 100644
--- a/src/interp/fortcall.boot
+++ b/src/interp/fortcall.boot
@@ -195,7 +195,7 @@ getCType t ==
XDRFun t ==
LISTP(ty := second t) =>
- if first(ty)='"char" then '"wrapstring" else '"array"
+ if first(ty) is '"char" then '"wrapstring" else '"array"
ty
printDec(type,dec,asps,fp) ==
diff --git a/src/interp/i-eval.boot b/src/interp/i-eval.boot
index 509d247d..fff7367a 100644
--- a/src/interp/i-eval.boot
+++ b/src/interp/i-eval.boot
@@ -363,7 +363,7 @@ evalFormMkValue(op,form,tm) ==
[tm]
failCheck x ==
- x = '"failed" =>
+ x is '"failed" =>
stopTimingProcess peekTimedName()
THROW('interpreter,objNewWrap('"failed",$String))
x = $coerceFailure =>
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index dfaaef34..daaa481d 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -952,8 +952,8 @@ matchMmSigTar(t1,t2) ==
null t1 or
isEqualOrSubDomain(t2,t1) => true
if t2 is ['Union,a,b] then
- if a='"failed" then return matchMmSigTar(t1, b)
- if b='"failed" then return matchMmSigTar(t1, a)
+ if a is '"failed" then return matchMmSigTar(t1, b)
+ if b is '"failed" then return matchMmSigTar(t1, a)
$Coerce and
isPartialMode t1 => resolveTM(t2,t1)
-- I think this should be true -SCM
diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot
index da007339..38ac6a62 100644
--- a/src/interp/i-resolv.boot
+++ b/src/interp/i-resolv.boot
@@ -144,7 +144,7 @@ resolveTTUnion(t1 is ['Union,:doms],t2) ==
ud := nil
bad := nil
for d in doms while not bad repeat
- d = '"failed" => ud := [d,:ud]
+ d is '"failed" => ud := [d,:ud]
null (d' := resolveTT(d,t2)) => bad := true
ud := [d',:ud]
bad => NIL
@@ -152,7 +152,7 @@ resolveTTUnion(t1 is ['Union,:doms],t2) ==
ud := nil
bad := nil
for d in doms2 while not bad repeat
- d = '"failed" => ud := append(ud,[d])
+ d is '"failed" => ud := append(ud,[d])
null (d' := resolveTTUnion(t1,d)) => bad := true
ud := append(ud,rest d')
bad => NIL
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index adb03fe6..c3901bd0 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -572,7 +572,7 @@ findConstructorSlotNumber(domainForm,domain,op,sig) ==
systemErrorHere ["findConstructorSlotNumber",domainForm]
bustUnion d ==
- d is ["Union",domain,utype] and utype='"failed" => domain
+ d is ["Union",domain,'"failed"] => domain
d
getSlotNumberFromOperationAlist(domainForm,op,sig) ==
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index dbb08f18..26878aac 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -563,12 +563,13 @@ brightPrint(x,out == $OutputStream) ==
brightPrint0(x,out == $OutputStream) ==
$texFormatting => brightPrint0AsTeX(x,out)
if IDENTP x then x := PNAME x
+ not string? x => brightPrintHighlight(x,out)
-- if the first character is a backslash and the second is a percent sign,
-- don't try to give the token any special interpretation. Just print
-- it without the backslash.
- string? x and STRINGLENGTH x > 1 and x.0 = char "\" and x.1 = char "%" =>
+ STRINGLENGTH x > 1 and x.0 = char "\" and x.1 = char "%" =>
sayString(SUBSTRING(x,1,NIL),out)
x = '"%l" =>
sayNewLine(out)
@@ -597,8 +598,7 @@ brightPrint0(x,out == $OutputStream) ==
or stdStreamIsTerminal(1) = 0 => sayString('" ",out)
not $highlightAllowed => sayString('" ",out)
sayString($highlightFontOff,out)
- string? x => sayString(x,out)
- brightPrintHighlight(x,out)
+ sayString(x,out)
brightPrint0AsTeX(x, out == $OutputStream) ==
x = '"%l" =>