aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-12-28 23:39:44 +0000
committerdos-reis <gdr@axiomatics.org>2010-12-28 23:39:44 +0000
commitca4b1b74d8e743f50f0db37f1b33265f46547f01 (patch)
treecfa8803798bef9eb304da47b18ef024c5c39b702 /src/interp
parent9ddf05bc7781163fbd6bd2b894337d8721de117a (diff)
downloadopen-axiom-ca4b1b74d8e743f50f0db37f1b33265f46547f01.tar.gz
Character constants clean up
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/br-saturn.boot4
-rw-r--r--src/interp/buildom.boot2
-rw-r--r--src/interp/c-util.boot9
-rw-r--r--src/interp/compiler.boot6
-rw-r--r--src/interp/fortcall.boot14
-rw-r--r--src/interp/g-util.boot10
-rw-r--r--src/interp/ht-util.boot4
-rw-r--r--src/interp/i-coerfn.boot2
-rw-r--r--src/interp/i-funsel.boot2
-rw-r--r--src/interp/i-output.boot4
-rw-r--r--src/interp/interop.boot2
-rw-r--r--src/interp/modemap.boot10
-rw-r--r--src/interp/pspad1.boot2
-rw-r--r--src/interp/pspad2.boot8
-rw-r--r--src/interp/server.boot2
-rw-r--r--src/interp/sys-constants.boot4
-rw-r--r--src/interp/wi2.boot10
17 files changed, 48 insertions, 47 deletions
diff --git a/src/interp/br-saturn.boot b/src/interp/br-saturn.boot
index e40099e2..362aee5d 100644
--- a/src/interp/br-saturn.boot
+++ b/src/interp/br-saturn.boot
@@ -342,8 +342,8 @@ saturnTERPRI() ==
TERPRI()
writeSaturnTable line ==
- open := charPosition(char '"_{",line,0)
- close:= charPosition(char '"_}",line,0)
+ open := charPosition(char "{",line,0)
+ close:= charPosition(char "}",line,0)
open < close =>
close := findBalancingBrace(line,open + 1,MAXINDEX line,0) or error '"no balancing brace"
writeSaturnPrint SUBSTRING(line,0,close + 1)
diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot
index 1488064b..d885b1c1 100644
--- a/src/interp/buildom.boot
+++ b/src/interp/buildom.boot
@@ -302,7 +302,7 @@ constructorCategory (title is [op,:.]) ==
cat:=
JoinInner([eval $SetCategory,mkCategory("domain",oplist,nil,nil,nil)],
$EmptyEnvironment)
- cat.(0):= title
+ cat.0 := title
cat
--mkMappingFunList(nam,mapForm,e) == [[],e]
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 000eefb9..a9f5f516 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -604,7 +604,8 @@ isConstantId(name,e) ==
isFalse() == nil
-isFluid s == atom s and "$"=(PNAME s).(0)
+isFluid s ==
+ atom s and char "$" = PNAME(s).0
isFunction(x,e) ==
get(x,"modemap",e) or GETL(x,"SPECIAL") or x="case" or getmode(x,e) is [
@@ -621,7 +622,7 @@ makeLiteral(x,e) ==
put(x,"isLiteral","true",e)
isSomeDomainVariable s ==
- IDENTP s and #(x:= PNAME s)>2 and x.(0)="#" and x.(1)="#"
+ IDENTP s and #(x:= PNAME s)>2 and x.0 = char "#" and x.1 = char "#"
++ Return non-nil is the domain form `x' is a `subset' of domain
++ form `y' in the environment `e'. The relation of subdomain
@@ -868,9 +869,9 @@ extendsCategoryForm(domain,form,form') ==
formVec:=(compMakeCategoryObject(form,$e)).expr
--Must be $e to pick up locally bound domains
form' is ["SIGNATURE",op,args,:.] =>
- assoc([op,args],formVec.(1)) or
+ assoc([op,args],formVec.1) or
assoc(SUBSTQ(domain,"$",[op,args]),
- SUBSTQ(domain,"$",formVec.(1)))
+ SUBSTQ(domain,"$",formVec.1))
form' is ["ATTRIBUTE",at] =>
assoc(at,formVec.2) or
assoc(SUBSTQ(domain,"$",at),SUBSTQ(domain,"$",formVec.2))
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 4a5dd20b..36d29900 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1040,7 +1040,7 @@ compSeq1(l,$exitModeStack,e) ==
if c="failed" then return nil
catchTag:= MKQ gensym()
form:= ["SEQ",:replaceExitEtc(c,catchTag,"TAGGEDexit",$exitModeStack.(0))]
- [["CATCH",catchTag,form],$exitModeStack.(0),$finalEnv]
+ [["CATCH",catchTag,form],$exitModeStack.0,$finalEnv]
compSeqItem(x,m,e) ==
comp(macroExpand(x,e),m,e)
@@ -1200,14 +1200,14 @@ compElt(form,m,E) ==
modemap:=
-- FIXME: do this only for constants.
n:=#mmList
- 1=n => mmList.(0)
+ 1=n => mmList.0
0=n =>
return
stackMessage('"Operation %1b missing from domain: %2p",
[anOp,aDomain])
stackWarning('"more than 1 modemap for: %1 with dc = %2p ===> %3",
[anOp,aDomain,mmList])
- mmList.(0)
+ mmList.0
[sig,[pred,val]]:= modemap
#sig ~= 2 and val isnt ["CONST",:.] => nil
val := genDeltaEntry([opOf anOp,:modemap],E)
diff --git a/src/interp/fortcall.boot b/src/interp/fortcall.boot
index 061e1bb1..147323e2 100644
--- a/src/interp/fortcall.boot
+++ b/src/interp/fortcall.boot
@@ -102,7 +102,7 @@ writeCFile(name,args,fortranArgs,dummies,decls,results,returnType,asps,fp) ==
writeLine('" XDR xdrs;",fp)
writeLine('" {",fp)
if $addUnderscoreToFortranNames then
- routineName := strconc(name,STRING CODE_-CHAR 95)
+ routineName := strconc(name,charString abstractChar 95)
else
routineName := name
-- If it is a function then give it somewhere to stick its result:
@@ -160,7 +160,7 @@ isPointer?(u,decls) ==
printCName(u,ispointer,asps,fp) ==
member(u,asps) =>
PRINC(u,fp)
- if $addUnderscoreToFortranNames then PRINC(STRING CODE_-CHAR 95,fp)
+ if $addUnderscoreToFortranNames then PRINC(charString abstractChar 95,fp)
if not ispointer then PRINC('"&",fp)
PRINC(u,fp)
@@ -202,7 +202,7 @@ printDec(type,dec,asps,fp) ==
wt(['" ",if LISTP(type) then first(type) else type,'" "],fp)
member(dec,asps) =>
if $addUnderscoreToFortranNames then
- wl([dec,STRING CODE_-CHAR 95,'"();"],fp)
+ wl([dec,charString abstractChar 95,'"();"],fp)
else
wl([dec,'"();"],fp)
LISTP(type) =>
@@ -758,7 +758,7 @@ multiToUnivariate f ==
newVariable := gensym()
for index in 0..#vars-1 repeat
-- Remember that AXIOM lists, vectors etc are indexed from 1
- body := NSUBST(["elt",newVariable,index+1],vars.(index),body)
+ body := NSUBST(["elt",newVariable,index+1],vars.index,body)
-- We want a Vector DoubleFloat -> DoubleFloat
target := [["DoubleFloat"],["Vector",["DoubleFloat"]]]
rest interpret ["ADEF",[newVariable],target,[[],[]],body]
@@ -781,8 +781,8 @@ functionAndJacobian f ==
newVariable := gensym()
for index in 0..#vars-1 repeat
-- Remember that AXIOM lists, vectors etc are indexed from 1
- funBodies := NSUBST(["elt",newVariable,index+1],vars.(index),funBodies)
- jacBodies := NSUBST(["elt",newVariable,index+1],vars.(index),jacBodies)
+ funBodies := NSUBST(["elt",newVariable,index+1],vars.index,funBodies)
+ jacBodies := NSUBST(["elt",newVariable,index+1],vars.index,jacBodies)
target := [["Vector",["DoubleFloat"]],["Vector",["DoubleFloat"]],["Integer"]]
rest interpret
["ADEF",[newVariable,"flag"],target,[[],[],[]],_
@@ -803,7 +803,7 @@ vectorOfFunctions f ==
newVariable := gensym()
for index in 0..#vars-1 repeat
-- Remember that AXIOM lists, vectors etc are indexed from 1
- funBodies := NSUBST(["elt",newVariable,index+1],vars.(index),funBodies)
+ funBodies := NSUBST(["elt",newVariable,index+1],vars.index,funBodies)
target := [["Vector",["DoubleFloat"]],["Vector",["DoubleFloat"]]]
rest interpret ["ADEF",[newVariable],target,[[],[]],["vector",["construct",:funBodies]]]
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 13b381b7..93aac9dc 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -1326,11 +1326,11 @@ $charRbrace == char '_}
$charBack == char '_\
$charDash == char '_-
-$charTab == CODE_-CHAR(9)
-$charNewline == CODE_-CHAR(10)
-$charFauxNewline == CODE_-CHAR(25)
-$stringNewline == PNAME CODE_-CHAR(10)
-$stringFauxNewline == PNAME CODE_-CHAR(25)
+$charTab == abstractChar 9
+$charNewline == abstractChar 10
+$charFauxNewline == abstractChar 25
+$stringNewline == charString abstractChar 10
+$stringFauxNewline == charString abstractChar 25
$charExclusions == [char 'a, char 'A]
$charQuote == char '_'
diff --git a/src/interp/ht-util.boot b/src/interp/ht-util.boot
index d04cd526..f7b3b6b9 100644
--- a/src/interp/ht-util.boot
+++ b/src/interp/ht-util.boot
@@ -561,8 +561,8 @@ bracketString string == strconc('"[",string,'"]")
quoteString string == strconc('"_"", string, '"_"")
-$funnyQuote := char 127
-$funnyBacks := char 128
+$funnyQuote := abstractChar 127
+$funnyBacks := abstractChar 128
htEscapeString str ==
str := SUBSTITUTE($funnyQuote, char '_", str)
diff --git a/src/interp/i-coerfn.boot b/src/interp/i-coerfn.boot
index c8ade7a3..9d95a741 100644
--- a/src/interp/i-coerfn.boot
+++ b/src/interp/i-coerfn.boot
@@ -706,7 +706,7 @@ M2Rm(x,source is [.,R],[.,p,q,S]) ==
M2Sm(x,source is [.,R],[.,p,S]) ==
x = '_$fromCoerceable_$ => nil
n:= #x
- m:= #x.(0)
+ m:= #x.0
n=m and m=p => M2M(x,source,[nil,S])
coercionFailure()
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index bdb13805..37939a6a 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -517,7 +517,7 @@ argCouldBelongToSubdomain(op, nargs) ==
-- each signature has form
-- [domain of implementation, target, arg1, arg2, ...]
for [sig,cond,:.] in mms repeat
- for t in CDDR sig for i in 0..(nargs) repeat
+ for t in CDDR sig for i in 0..nargs repeat
CONTAINEDisDomain(t,cond) =>
v.i := 1 + v.i
v
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index 654b2827..f064be78 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -166,9 +166,9 @@ $plainRTspecialCharacters == [
++ End of Transmission character; usually to the Algebra Output
++ Stream in lean mode.
-$RecordSeparator == CODE_-CHAR 30
+$RecordSeparator == abstractChar 30
-makeCharacter n ==> INTERN(STRING(CODE_-CHAR n))
+makeCharacter n ==> INTERN(charString abstractChar n)
$RTspecialCharacters == [
makeCharacter 218, -- upper left corner (+)
diff --git a/src/interp/interop.boot b/src/interp/interop.boot
index fd146ff0..e900dabe 100644
--- a/src/interp/interop.boot
+++ b/src/interp/interop.boot
@@ -108,7 +108,7 @@ SExprToDName(sexpr, cosigVal) ==
-- local garbage because Compiler strings are null terminated
StringToCompStr(str) ==
- strconc(str, STRING (CODE_-CHAR 0))
+ strconc(str, charString abstractChar 0)
CompStrToString(str) ==
SUBSTRING(str, 0, (# str - 1))
diff --git a/src/interp/modemap.boot b/src/interp/modemap.boot
index d1256d48..1fabebd8 100644
--- a/src/interp/modemap.boot
+++ b/src/interp/modemap.boot
@@ -260,7 +260,7 @@ substituteCategoryArguments(argl,catform) ==
augModemapsFromCategoryRep(domainName,repDefn,functorBody,categoryForm,e) ==
[fnAlist,e]:= evalAndSub(domainName,domainName,domainName,categoryForm,e)
[repFnAlist,e]:= evalAndSub("Rep","Rep",repDefn,getmode(repDefn,e),e)
- catform:= (isCategory categoryForm => categoryForm.(0); categoryForm)
+ catform:= (isCategory categoryForm => categoryForm.0; categoryForm)
compilerMessage('"Adding %1p modemaps",[domainName])
e:= putDomainsInScope(domainName,e)
for [lhs:=[op,sig,:.],cond,fnsel] in fnAlist repeat
@@ -281,7 +281,7 @@ AMFCR_,redefined(opname,u) ==
augModemapsFromCategory(domainName,domainView,functorForm,categoryForm,e) ==
[fnAlist,e]:= evalAndSub(domainName,domainView,functorForm,categoryForm,e)
- -- catform:= (isCategory categoryForm => categoryForm.(0); categoryForm)
+ -- catform:= (isCategory categoryForm => categoryForm.0; categoryForm)
-- catform appears not to be used, so why set it?
--if not $InteractiveMode then
compilerMessage('"Adding %1p modemaps",[domainName])
@@ -314,7 +314,7 @@ augModemapsFromCategory(domainName,domainView,functorForm,categoryForm,e) ==
evalAndSub(domainName,viewName,functorForm,form,$e) ==
$lhsOfColon: local:= domainName
- isCategory form => [substNames(domainName,viewName,functorForm,form.(1)),$e]
+ isCategory form => [substNames(domainName,viewName,functorForm,form.1),$e]
--next lines necessary-- see MPOLY for which $ is actual arg. --- RDJ 3/83
if CONTAINED("$$",form) then $e:= put("$$","mode",get("$","mode",$e),$e)
opAlist:= getOperationAlist(domainName,functorForm,form)
@@ -328,8 +328,8 @@ getOperationAlist(name,functorForm,form) ==
(u:= isFunctor functorForm) and not
($insideFunctorIfTrue and first functorForm=first $functorForm) => u
$insideFunctorIfTrue and name="$" =>
- ($domainShell => $domainShell.(1); systemError '"$ has no shell now")
- T:= compMakeCategoryObject(form,$e) => ([.,.,$e]:= T; T.expr.(1))
+ ($domainShell => $domainShell.1; systemError '"$ has no shell now")
+ T:= compMakeCategoryObject(form,$e) => ([.,.,$e]:= T; T.expr.1)
stackMessage('"not a category form: %1bp",[form])
substNames(domainName,viewName,functorForm,opalist) ==
diff --git a/src/interp/pspad1.boot b/src/interp/pspad1.boot
index 8ba4e329..a9d40822 100644
--- a/src/interp/pspad1.boot
+++ b/src/interp/pspad1.boot
@@ -498,7 +498,7 @@ formatPrefix(op,arg,lbp,rbp,:options) ==
formatPrefixOp(op,:options) ==
qualification := IFCAR options
- op=char '" " => format " ="
+ op = char " " => format " ="
qualification or GETL(op,"Nud") and not MEMQ(op,$spadTightList) =>
formatQual(op,qualification) and format " "
format op
diff --git a/src/interp/pspad2.boot b/src/interp/pspad2.boot
index 92434706..c5bf7aa8 100644
--- a/src/interp/pspad2.boot
+++ b/src/interp/pspad2.boot
@@ -566,8 +566,8 @@ ident2PrintImage s ==
m := MAXINDEX s
if m > 1 and s.(m - 1) = $underScore then s := strconc(SUBSTRING(s,0,m-1),s.m)
u:= GETSTR (2*# s)
- if not (alphabetic? s.(0) or s.(0)=char '"$") then SUFFIX('__,u)
- u:= SUFFIX(s.(0),u)
+ if not (alphabetic? s.0 or s.0 = char "$") then SUFFIX('__,u)
+ u:= SUFFIX(s.0,u)
for i in 1..MAXINDEX s repeat
if not (digit? s.i or alphabetic? s.i or ((c := s.i) = char '?)
or (c = char '_!)) then SUFFIX('__,u)
@@ -578,10 +578,10 @@ isIdentifier x ==
IDENTP x =>
s:= PNAME x
#s = 0 => nil
- alphabetic? s.(0) => and/[s.i ~= char '" " for i in 1..MAXINDEX s]
+ alphabetic? s.0 => and/[s.i ~= char " " for i in 1..MAXINDEX s]
#s>1 =>
or/[alphabetic? s.i for i in 1..(m:= MAXINDEX s)] =>
- and/[s.i ~= char '" " for i in 1..m] => true
+ and/[s.i ~= char " " for i in 1..m] => true
isGensym x ==
s := STRINGIMAGE x
diff --git a/src/interp/server.boot b/src/interp/server.boot
index 39efd26b..b1b6658f 100644
--- a/src/interp/server.boot
+++ b/src/interp/server.boot
@@ -151,7 +151,7 @@ parseAndEvalStr string ==
parseAndEvalStr1 string
parseAndEvalStr1 string ==
- string.0 = char '")" =>
+ string.0 = char ")" =>
doSystemCommand SUBSEQ(string, 1)
processInteractive(ncParseFromString string, NIL)
diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot
index c8e454d3..e113f4fe 100644
--- a/src/interp/sys-constants.boot
+++ b/src/interp/sys-constants.boot
@@ -105,7 +105,7 @@ _/MAJOR_-VERSION ==
++ Glyph for a box
$boxString ==
- strconc(STRING CODE_-CHAR 29, STRING CODE_-CHAR 226)
+ strconc(charString abstractChar 29, charString abstractChar 226)
++ Glyph for an APL quad
$quadSymbol ==
@@ -119,7 +119,7 @@ $quadSymbol ==
++ The escape character, in string form
$escapeString ==
- STRING CODE_-CHAR 27
+ charString abstractChar 27
++ Marker to swicth to bold font
$boldString ==
diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot
index 6641599a..5d35ac34 100644
--- a/src/interp/wi2.boot
+++ b/src/interp/wi2.boot
@@ -137,7 +137,7 @@ compDefineFunctor1(df, m,$e,$prefix,$formalArgList) ==
then $e:= augModemapsFromCategoryRep('_$,ab,cb,target,$e)
else $e:= augModemapsFromCategory('_$,'_$,'_$,target,$e)
$signature:= signature'
- operationAlist:= SUBLIS($pairlis,$domainShell.(1))
+ operationAlist:= SUBLIS($pairlis,$domainShell.1)
parSignature:= SUBLIS($pairlis,signature')
parForm:= SUBLIS($pairlis,form)
@@ -477,7 +477,7 @@ compFormWithModemap1(form,m,e,modemap,Rep2Dollar?) ==
Tl => (LAST Tl).env
e
[x',m',e'] where
- m':= SUBLIS(sl,map.(1))
+ m':= SUBLIS(sl,map.1)
x':=
form':= [f,:[t.expr for t in Tl]]
m'=$Category or isCategoryForm(m',e) => form'
@@ -509,7 +509,7 @@ compElt(origForm,m,E) ==
mmList:= getModemapListFromDomain(anOp,0,aDomain,E)
modemap:=
n:=#mmList
- 1=n => mmList.(0)
+ 1=n => mmList.0
0=n =>
return
stackMessage ['"Operation ","%b",anOp,"%d",
@@ -517,7 +517,7 @@ compElt(origForm,m,E) ==
stackWarning ['"more than 1 modemap for: ",anOp,
'" with dc=",aDomain,'" ===>"
,mmList]
- mmList.(0)
+ mmList.0
----------> new: <-----------
if aDomain = 'Rep then
modemap := SUBST('Rep,'_$,modemap)
@@ -736,7 +736,7 @@ compReduce1(form is ["REDUCE",op,.,collectForm],m,e,$formalArgList) ==
markImport m
[collectOp,:itl,body]:= collectForm
$e:= e
- itl:= [([.,$e]:= compIterator(x,$e) or return "failed").(0) for x in itl]
+ itl:= [([.,$e]:= compIterator(x,$e) or return "failed").0 for x in itl]
itl="failed" => return nil
e:= $e
T0 := comp0(body,m,e) or return nil