aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-04-17 22:37:43 +0000
committerdos-reis <gdr@axiomatics.org>2011-04-17 22:37:43 +0000
commitc552f9de83083a649b74510b522ceaebbbc0283b (patch)
treea69dfbba85de4e384f172ebc0f47e12f7c63ebd2 /src
parent0de5ea3df4ffff2d97202a66629e19e0579410ea (diff)
downloadopen-axiom-c552f9de83083a649b74510b522ceaebbbc0283b.tar.gz
cleanup
Diffstat (limited to 'src')
-rw-r--r--src/interp/bc-util.boot4
-rw-r--r--src/interp/br-con.boot16
-rw-r--r--src/interp/br-data.boot13
-rw-r--r--src/interp/br-op1.boot2
-rw-r--r--src/interp/br-prof.boot4
-rw-r--r--src/interp/br-saturn.boot2
-rw-r--r--src/interp/br-search.boot4
-rw-r--r--src/interp/c-doc.boot47
-rw-r--r--src/interp/define.boot4
-rw-r--r--src/interp/functor.boot3
-rw-r--r--src/interp/g-util.boot25
-rw-r--r--src/interp/guess.boot8
-rw-r--r--src/interp/htcheck.boot2
-rw-r--r--src/interp/htsetvar.boot2
-rw-r--r--src/interp/int-top.boot8
-rw-r--r--src/interp/record.boot6
-rw-r--r--src/interp/word.boot4
17 files changed, 80 insertions, 74 deletions
diff --git a/src/interp/bc-util.boot b/src/interp/bc-util.boot
index 7f69eeb8..74b2e0ec 100644
--- a/src/interp/bc-util.boot
+++ b/src/interp/bc-util.boot
@@ -97,9 +97,9 @@ bcString2WordList s == fn(s,0,maxIndex s) where
fn(s,i,n) ==
i > n => nil
k := or/[j for j in i..n | s.j ~= char " "]
- null integer? k => nil
+ not integer? k => nil
l := bcFindString(s,k + 1,n,char " ")
- null integer? l => [subString(s,k)]
+ not integer? l => [subString(s,k)]
[subString(s,k,l-k),:fn(s,l + 1,n)]
diff --git a/src/interp/br-con.boot b/src/interp/br-con.boot
index bbb341b2..7ae9a7c6 100644
--- a/src/interp/br-con.boot
+++ b/src/interp/br-con.boot
@@ -175,7 +175,8 @@ kdPageInfo(name,abbrev,nargs,conform,signature,file?) ==
htSayStandard '"\indentrel{2}"
if nargs > 0 then kPageArgs(conform,signature)
htSayStandard '"\indentrel{-2}"
- if name.(#name-1) = char "&" then name := subSequence(name, 0, #name-1)
+ if isDefautPackageName makeSymbol name then
+ name := subSequence(name, 0, #name-1)
--sourceFileName := dbSourceFile makeSymbol name
sourceFileName := getConstructorSourceFileFromDB makeSymbol name
filename := extractFileNameFromPath sourceFileName
@@ -427,7 +428,7 @@ kcPage(htPage,junk) ==
htpSetProperty(htPage,'heading,heading)
if kind = '"category" and dbpHasDefaultCategory? xpart then
htSay '"This category has default package "
- bcCon(strconc(name,'"&"),'"")
+ bcCon(symbolName makeDefaultPackageName name,'"")
htSayStandard '"\newline"
htBeginMenu(3)
htSayStandard '"\item "
@@ -583,7 +584,7 @@ kcdePage(htPage,junk) ==
kind ~= '"default package" => ncParseFromString constring
[makeSymbol name,:rest ncParseFromString strconc('"d",args)] --because of &
pakname :=
--- kind = '"category" => makeSymbol strconc(name,'"&")
+-- kind = '"category" => makeDefaultPackageName name
opOf conform
domList := getDependentsOfConstructor pakname
cAlist := [[getConstructorForm x,:true] for x in domList]
@@ -599,7 +600,7 @@ kcuPage(htPage,junk) ==
kind ~= '"default package" => ncParseFromString constring
[makeSymbol name,:rest ncParseFromString strconc('"d",args)] --because of &
pakname :=
- kind = '"category" => makeSymbol strconc(name,'"&")
+ kind = '"category" => makeDefaultPackageName name
opOf conform
domList := getUsersOfConstructor pakname
cAlist := [[getConstructorForm x,:true] for x in domList]
@@ -620,7 +621,7 @@ kcnPage(htPage,junk) ==
htpSetProperty(htPage,'heading,heading)
conform:= htpProperty(htPage,'conform)
pakname :=
- kind = '"category" => makeSymbol strconc(PNAME name,'"&")
+ kind = '"category" => makeDefaultPackageName PNAME name
opOf conform
domList := getImports pakname
if domname then
@@ -1309,13 +1310,14 @@ PUT('Enumeration, 'documentation, substitute(MESSAGE, 'MESSAGE, '(
mkConArgSublis args ==
[[arg,:makeSymbol digits2Names PNAME arg] for arg in args
- | (s := PNAME arg) and "or"/[digit? s.i for i in 0..maxIndex s]]
+ | (s := PNAME arg) and
+ "or"/[digit? stringChar(s,i) for i in 0..maxIndex s]]
digits2Names s ==
--This is necessary since arguments of conforms CANNOT have digits in TechExplorer
str := '""
for i in 0..maxIndex s repeat
- c := s.i
+ c := stringChar(s,i)
segment :=
n := digit? c =>
('("Zero" "One" "Two" "Three" "Four" "Five" "Six" "Seven" "Eight" "Nine")).n
diff --git a/src/interp/br-data.boot b/src/interp/br-data.boot
index 3983fde5..fd098631 100644
--- a/src/interp/br-data.boot
+++ b/src/interp/br-data.boot
@@ -106,21 +106,20 @@ buildLibdbConEntry conname ==
null $conform => nil
$exposed? := (isExposedConstructor conname => '"x"; '"n")
$doc := getConstructorDocumentationFromDB conname
- pname := PNAME conname
kind := getConstructorKindFromDB conname
if kind = 'domain
and getConstructorModemapFromDB conname is [[.,t,:.],:.]
and t is ['CATEGORY,'package,:.] then kind := 'package
$kind :=
- pname.(maxIndex pname) = char "&" => 'x
- DOWNCASE PNAME(kind).0
+ isDefaultPackageName conname => 'x
+ DOWNCASE symbolName(kind).0
argl := rest $conform
conComments :=
LASSOC('constructor,$doc) is [[=nil,:r]] => libdbTrim concatWithBlanks r
'""
argpart:= subString(form2HtString ['f,:argl],1)
sigpart:= libConstructorSig $conform
- header := strconc($kind,PNAME conname)
+ header := strconc($kind,symbolName conname)
buildLibdbString [header,#argl,$exposed?,sigpart,argpart,abb,conComments]
dbMkForm x == atom x and [x] or x
@@ -190,13 +189,13 @@ libdbTrim s ==
k := maxIndex s
k < 0 => s
for i in 0..k repeat
- s.i = $Newline => s.i := char " "
+ stringChar(s,i) = $Newline => stringChar(s,i) := char " "
trimString s
checkCommentsForBraces(kind,sop,sigpart,comments) ==
count := 0
for i in 0..maxIndex comments repeat
- c := comments.i
+ c := stringChar(comments,i)
c = char "{" => count := count + 1
c = char "}" =>
count := count - 1
@@ -435,7 +434,7 @@ mkUsersHashTable() == --called by buildDatabase (database.boot)
getDefaultPackageClients con == --called by mkUsersHashTable
catname := makeSymbol subString(s := PNAME con,0,maxIndex s)
for [catAncestor,:.] in childrenOf([catname]) repeat
- pakname := makeSymbol strconc(PNAME catAncestor,'"&")
+ pakname := makeDefaultPackageName symbolName catAncestor
if getCDTEntry(pakname,true) then acc := [pakname,:acc]
acc := union([CAAR x for x in domainsOf([catAncestor],nil)],acc)
listSort(function GLESSEQP,acc)
diff --git a/src/interp/br-op1.boot b/src/interp/br-op1.boot
index 2e50119b..ddd70f07 100644
--- a/src/interp/br-op1.boot
+++ b/src/interp/br-op1.boot
@@ -566,7 +566,7 @@ dbShowKind conform ==
conname := first conform
kind := getConstructorKindFromDB conname
kind = "domain" =>
- (s := PNAME conname).(maxIndex s) = '_& => '"default package"
+ isDefaultPackageName conname => '"default package"
'"domain"
PNAME kind
diff --git a/src/interp/br-prof.boot b/src/interp/br-prof.boot
index bb5d4e32..b9650ae0 100644
--- a/src/interp/br-prof.boot
+++ b/src/interp/br-prof.boot
@@ -78,7 +78,7 @@ dbShowInfoOp(htPage,op,sig,alist) ==
kind := getConstructorKindFromDB conname
honestConform :=
kind = 'category =>
- [makeSymbol strconc(PNAME conname,'"&"),"$",:rest conform]
+ [makeDefaultPackageName symbolName conname,"$",:rest conform]
conform
faTypes := CDDAR getConstructorModemapFromDB conname
@@ -252,7 +252,7 @@ hasNewInfoText u ==
getInfoAlist conname ==
cat? := getConstructorKindFromDB conname = "category"
- if cat? then conname := makeSymbol strconc(STRINGIMAGE conname,'"&")
+ if cat? then conname := makeDefaultPackageName symbolName conname
abb := getConstructorAbbreviationFromDB conname or return '"not a constructor"
fs := strconc(PNAME abb,'".NRLIB/info")
inStream :=
diff --git a/src/interp/br-saturn.boot b/src/interp/br-saturn.boot
index 98b9543f..ace5f046 100644
--- a/src/interp/br-saturn.boot
+++ b/src/interp/br-saturn.boot
@@ -244,7 +244,7 @@ writeSaturn(line) ==
n := maxIndex line
while --advance k if true
k > n => false
- line.k ~= char "\" => true
+ stringChar(line,k) ~= char "\" => true
code := isBreakSegment?(line, k + 1,n) => false
true
repeat (k := k + 1)
diff --git a/src/interp/br-search.boot b/src/interp/br-search.boot
index ef927571..8f6deb7a 100644
--- a/src/interp/br-search.boot
+++ b/src/interp/br-search.boot
@@ -60,7 +60,7 @@ grepConstruct1(s,key) ==
--returns the name of file (WITHOUT .text.$SPADNUM on the end)
$key : local := key
if key = 'k and --convert 'k to 'y if name contains an "&"
- or/[s . i = char "&" for i in 0..maxIndex s] then key := 'y
+ or/[stringChar(s,i) = char "&" for i in 0..maxIndex s] then key := 'y
filter := pmTransFilter STRINGIMAGE s --parses and-or-not form
filter is ['error,:.] => filter --exit on parser error
pattern := mkGrepPattern(filter,key) --create string to pass to "grep"
@@ -92,7 +92,7 @@ grepForAbbrev(s,key) ==
someLowerCaseChar := false
someUpperCaseChar := false
for i in 0..maxIndex s repeat
- c := s . i
+ c := stringChar(s,i)
lowerCase? c => return (someLowerCaseChar := true)
upperCase? c => someUpperCaseChar := true
someLowerCaseChar or not someUpperCaseChar => false
diff --git a/src/interp/c-doc.boot b/src/interp/c-doc.boot
index 8cc63229..d7812979 100644
--- a/src/interp/c-doc.boot
+++ b/src/interp/c-doc.boot
@@ -629,11 +629,11 @@ newWordFrom(l,i,m) ==
while i <= m and l.i = char " " repeat i := i + 1
i > m => NIL
buf := '""
- ch := l.i
+ ch := stringChar(l,i)
ch = $charFauxNewline => [$stringFauxNewline, i+ 1]
done := false
while i <= m and not done repeat
- ch := l.i
+ ch := stringChar(l,i)
ch = $charBlank or ch = $charFauxNewline => done := true
buf := strconc(buf, charString ch)
i := i + 1
@@ -641,10 +641,10 @@ newWordFrom(l,i,m) ==
checkAddPeriod s == --No, just leave blank at the end (rdj: 10/18/91)
m := maxIndex s
- lastChar := s . m
+ lastChar := stringChar(s,m)
lastChar = char "!" or lastChar = char "?" or lastChar = char "." => s
lastChar = char "," or lastChar = char ";" =>
- s . m := char "."
+ stringChar(s,m) := char "."
s
s
@@ -657,7 +657,7 @@ checkGetArgs u ==
k := getMatchingRightPren(u,6,char "{",char "}") or m
checkGetArgs subString(u,6,k-6)
(i := charPosition(char "(",u,0)) > m => nil
- (u . m) ~= char ")" => nil
+ stringChar(u,m) ~= char ")" => nil
while (k := charPosition($charComma,u,i + 1)) < m repeat
acc := [trimString subString(u,i + 1,k - i - 1),:acc]
i := k
@@ -677,7 +677,7 @@ firstNonBlankPosition(x,:options) ==
start := IFCAR options or 0
k := -1
for i in start..maxIndex x repeat
- if x.i ~= $charBlank then return (k := i)
+ if stringChar(x,i) ~= $charBlank then return (k := i)
k
checkAddIndented(x,margin) ==
@@ -691,7 +691,7 @@ checkAddSpaceSegments(u,k) ==
i := charPosition($charBlank,u,k)
m < i => u
j := i
- while (j := j + 1) < m and u.j = char " " repeat 'continue
+ while (j := j + 1) < m and stringChar(u,j) = char " " repeat 'continue
n := j - i --number of blanks
n > 1 => strconc(subString(u,0,i),'"\space{",
STRINGIMAGE n,'"}",checkAddSpaceSegments(subString(u,i + n),0))
@@ -716,7 +716,7 @@ checkTrim($x,lines) == main where
return subString(s,k + 2)
m := maxIndex s
n := k + 2
- for j in (k + 2)..m while s.j = $charBlank repeat (n := n + 1)
+ for j in (k + 2)..m while stringChar(s,j) = $charBlank repeat (n := n + 1)
subString(s,n)
checkExtract(header,lines) ==
@@ -740,7 +740,7 @@ checkExtract(header,lines) ==
m := #line
(k := firstNonBlankPosition line) = -1 => 'skip --include if blank
k > margin => 'skip --include if idented
- not upperCase? line.k => 'skip --also if not upcased
+ not upperCase? stringChar(line,k) => 'skip --also if not upcased
(j := charPosition(char ":",line,k)) = m => 'skip --or if not colon, or
(i := charPosition(char " ",line,k+1)) < j => 'skip --blank before colon
return nil
@@ -835,8 +835,8 @@ checkDecorate u ==
hasNoVowels x ==
max := maxIndex x
- x.max = char "y" => false
- and/[not isVowel(x.i) for i in 0..max]
+ stringChar(x,max) = char "y" => false
+ and/[not isVowel stringChar(x,i) for i in 0..max]
isVowel c ==
c=char "a" or c=char "e" or c=char "i" or c=char "o" or c=char "u" or
@@ -852,7 +852,7 @@ checkAddBackSlashes s ==
insertIndex := nil
while k <= m repeat
do
- char := s.k
+ char := stringChar(s,k)
char = $charBack => k := k + 2
MEMQ(char,$charEscapeList) => return (insertIndex := k)
k := k + 1
@@ -962,14 +962,15 @@ checkSplitPunctuation x ==
m := maxIndex x
m < 1 => [x]
lastchar := x.m
- lastchar = $charPeriod and x.(m - 1) = $charPeriod =>
+ lastchar = $charPeriod and stringChar(x,m - 1) = $charPeriod =>
m = 1 => [x]
- m > 3 and x.(m-2) = $charPeriod =>
+ m > 3 and stringChar(x,m-2) = $charPeriod =>
[:checkSplitPunctuation subString(x,0,m-2),'"..."]
[:checkSplitPunctuation subString(x,0,m-1),'".."]
lastchar = $charPeriod or lastchar = $charSemiColon or lastchar = $charComma
=> [subString(x,0,m),lastchar]
- m > 1 and x.(m - 1) = $charQuote => [subString(x,0,m - 1),subString(x,m-1)]
+ m > 1 and stringChar(x,m - 1) = $charQuote =>
+ [subString(x,0,m - 1),subString(x,m-1)]
(k := charPosition($charBack,x,0)) < m =>
k = 0 =>
m = 1 or HGET($htMacroTable,x) or alphabetic? x.1 => [x]
@@ -990,7 +991,7 @@ checkSplitOn(x) ==
while l repeat
char := first l
do
- m = 0 and x.0 = char => return (k := -1) --special exit
+ m = 0 and stringChar(x,0) = char => return (k := -1) --special exit
k := charPosition(char,x,0)
k > 0 and x.(k - 1) = $charBack => [x]
k <= m => return k
@@ -1111,7 +1112,7 @@ checkLookForRightBrace(u) == --return line beginning with right brace
checkInteger s ==
CHARP s => false
s = '"" => false
- and/[digit? s.i for i in 0..maxIndex s]
+ and/[digit? stringChar(s,i) for i in 0..maxIndex s]
checkTransformFirsts(opname,u,margin) ==
--case 1: \spad{...
@@ -1127,11 +1128,11 @@ checkTransformFirsts(opname,u,margin) ==
strconc(fillerSpaces margin,checkTransformFirsts(opname,s,0))
m := maxIndex u
m < 2 => u
- u.0 = $charBack => u
+ stringChar(u,0) = $charBack => u
alphabetic? u.0 =>
i := checkSkipToken(u,0,m) or return u
j := checkSkipBlanks(u,i,m) or return u
- open := u.j
+ open := stringChar(u,j)
open = char "[" and (close := char "]") or
open = char "(" and (close := char ")") =>
k := getMatchingRightPren(u,j + 1,open,close)
@@ -1185,7 +1186,7 @@ getMatchingRightPren(u,j,open,close) ==
count := 0
m := maxIndex u
for i in j..m repeat
- c := u . i
+ c := stringChar(u,i)
do
c = close =>
count = 0 => return (found := i)
@@ -1194,12 +1195,12 @@ getMatchingRightPren(u,j,open,close) ==
found
checkSkipBlanks(u,i,m) ==
- while i < m and u.i = $charBlank repeat i := i + 1
+ while i < m and stringChar(u,i) = $charBlank repeat i := i + 1
i = m => nil
i
checkSkipToken(u,i,m) ==
- alphabetic?(u.i) => checkSkipIdentifierToken(u,i,m)
+ alphabetic? stringChar(u,i) => checkSkipIdentifierToken(u,i,m)
checkSkipOpToken(u,i,m)
checkSkipOpToken(u,i,m) ==
@@ -1309,7 +1310,7 @@ checkDecorateForHt u ==
-- not spadflag and string? x and (member(x,$argl) or #x = 1
-- and alphabetic? x.0) and not (x in '("a" "A")) =>
-- checkDocError1 ['"Naked ",x]
--- not spadflag and string? x and (not x.0 = $charBack and not digit?(x.0) and digit?(x.(maxIndex x))or x in '("true" "false"))
+-- not spadflag and string? x and (not x.0 = $charBack and not digit?(x.0) and digit? stringChar(x,maxIndex x) or x in '("true" "false"))
-- => checkDocError1 ["Naked ",x]
u := rest u
u
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 47c9f581..27b9498d 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -261,7 +261,7 @@ encodeCatform x ==
NRTcatCompare [catform,:pred] == LASSOC(first catform,$levelAlist)
hasDefaultPackage catname ==
- defname := makeSymbol strconc(catname,'"&")
+ defname := makeDefaultPackageName symbolName catname
constructor? defname => defname
nil
@@ -706,7 +706,7 @@ makeCategoryPredicates(form,u) ==
pl
mkCategoryPackage(form is [op,:argl],cat,def) ==
- packageName:= makeSymbol(strconc(symbolName op,'"&"))
+ packageName:= makeDefaultPackageName symbolName op
packageAbb := makeSymbol(strconc(getConstructorAbbreviationFromDB op,'"-"))
$options:local := []
-- This stops the next line from becoming confused
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index a8311049..9a72de7f 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -929,7 +929,8 @@ alistSize c ==
count(CDAR x,level+1)+count(rest x,level)
addSuffix(n,u) ==
- alphabetic?((s:= STRINGIMAGE u).(maxIndex s)) =>
+ s:= STRINGIMAGE u
+ alphabetic? stringChar(s,maxIndex s) =>
makeSymbol strconc(s,STRINGIMAGE n)
INTERNL strconc(s,STRINGIMAGE ";",STRINGIMAGE n)
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index dfc527b9..73d2e4a0 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -45,6 +45,7 @@ module g_-util where
isSubDomain: (%Mode,%Mode) -> %Form
usedSymbol?: (%Symbol,%Code) -> %Boolean
isDefaultPackageName: %Symbol -> %Boolean
+ makeDefaultPackageName: %String -> %Symbol
--%
@@ -667,9 +668,8 @@ sublisNQ(al,e) ==
opOf: %Thing -> %Thing
opOf x ==
- atom x => x
- first x
-
+ cons? x => x.op
+ x
getProplist: (%Thing,%Env) -> %List
search: (%Thing,%Env) -> %List
@@ -768,16 +768,16 @@ trimString s ==
leftTrim s ==
k := maxIndex s
k < 0 => s
- s.0 = $blank =>
- for i in 0..k while s.i = $blank repeat (j := i)
+ stringChar(s,0) = $blank =>
+ for i in 0..k while stringChar(s,i) = $blank repeat (j := i)
subString(s,j + 1)
s
rightTrim s == -- assumed a non-empty string
k := maxIndex s
k < 0 => s
- s.k = $blank =>
- for i in k..0 by -1 while s.i = $blank repeat (j := i)
+ stringChar(s,k) = $blank =>
+ for i in k..0 by -1 while stringChar(s,i) = $blank repeat (j := i)
subString(s,0,j)
s
@@ -791,7 +791,7 @@ pr x ==
intern x ==
string? x =>
- digit? x.0 => string2Integer x
+ digit? stringChar(x,0) => string2Integer x
makeSymbol x
x
@@ -878,13 +878,16 @@ isDefaultPackageName x ==
isDefaultPackageForm? x ==
x is [op,:.] and IDENTP op and isDefaultPackageName op
+makeDefaultPackageName x ==
+ makeSymbol strconc(x,'"&")
+
-- gensym utils
charDigitVal c ==
digits := '"0123456789"
n := -1
- for i in 0..#digits-1 while n < 0 repeat
- if c = digits.i then n := i
+ for i in 0..maxIndex digits while n < 0 repeat
+ if c = stringChar(digits,i) then n := i
n < 0 => error '"Character is not a digit"
n
@@ -892,7 +895,7 @@ gensymInt g ==
not GENSYMP g => error '"Need a GENSYM"
p := symbolName g
n := 0
- for i in 2..#p-1 repeat
+ for i in 2..maxIndex p repeat
n := 10 * n + charDigitVal stringChar(p,i)
n
diff --git a/src/interp/guess.boot b/src/interp/guess.boot
index 380a751d..27cf3723 100644
--- a/src/interp/guess.boot
+++ b/src/interp/guess.boot
@@ -69,13 +69,13 @@ wordsOfString(s) == [UPCASE x for x in wordsOfStringKeepCase s]
wordsOfStringKeepCase s == wordsOfString1(s,0) or [COPY s]
wordsOfString1(s,j) ==
- k := or/[i for i in j..(maxIndex(s)-1) | upperCase? s.i] =>
+ k := or/[i for i in j..(maxIndex(s)-1) | upperCase? stringChar(s,i)] =>
tailWords:=
upperCase? s.(k+1) =>
- n:= or/[i for i in (k+2)..(maxIndex(s)-1)|not upperCase? s.i]
+ n:= or/[i for i in (k+2)..(maxIndex(s)-1)| not upperCase? stringChar(s,i)]
null n => [subString(s,k)]
n > k+1 => [subString(s,k,n-k-1),:wordsOfString1(s,n-1)]
- m := or/[i for i in (k+2)..(maxIndex(s)-1) | upperCase? s.i] =>
+ m := or/[i for i in (k+2)..(maxIndex(s)-1) | upperCase? stringChar(s,i)] =>
[subString(s,k,m-k),:wordsOfString1(s,m)]
[subString(s,k)]
k > j+1 => [subString(s,j,k-j),:tailWords]
@@ -85,7 +85,7 @@ wordsOfString1(s,j) ==
wordKeys s ==
removeDuplicates [UPCASE s.0,:fn(s,1,-1,maxIndex s,nil)] where fn(s,i,lastKeyIndex,n,acc) ==
i > n => acc
- upperCase? s.i =>
+ upperCase? stringChar(s,i) =>
-- i = lastKeyIndex + 1 => fn(s,i + 1,i,n,[s.i,:rest acc])
fn(s,i + 1,i,n,[s.i,:acc])
fn(s,i + 1,lastKeyIndex,n,acc)
diff --git a/src/interp/htcheck.boot b/src/interp/htcheck.boot
index 23bce74e..d416508a 100644
--- a/src/interp/htcheck.boot
+++ b/src/interp/htcheck.boot
@@ -107,7 +107,7 @@ getHtMacroItem line ==
i = m => 0
j := charPosition(char "]",line,i + 1)
digitString := subString(line,i + 1,j - i - 1)
- and/[digit? digitString.i for i in 0..maxIndex digitString]
+ and/[digit? stringChar(digitString,i) for i in 0..maxIndex digitString]
=> readInteger digitString
return nil
[command,:numOfArgs]
diff --git a/src/interp/htsetvar.boot b/src/interp/htsetvar.boot
index 4eaf1d46..614b24a5 100644
--- a/src/interp/htsetvar.boot
+++ b/src/interp/htsetvar.boot
@@ -271,7 +271,7 @@ htCheck(checker,value) ==
parseWord x ==
string? x =>
- and/[digit? x.i for i in 0..maxIndex x] => readInteger x
+ and/[digit? stringChar(x,i) for i in 0..maxIndex x] => readInteger x
makeSymbol x
x
diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot
index a4d1bf5c..3fecbbd5 100644
--- a/src/interp/int-top.boot
+++ b/src/interp/int-top.boot
@@ -280,7 +280,7 @@ mkLineList lines ==
nonBlank str ==
value := false
for i in 0..maxIndex str repeat
- str.i ~= char " " =>
+ stringChar(str,i) ~= char " " =>
value := true
return value
value
@@ -294,10 +294,10 @@ ncloopCommand (line,n) ==
ncloopEscaped x==
esc :=false
done:=false
- for i in (# x) - 1 .. 0 by -1 while not done repeat
+ for i in maxIndex x .. 0 by -1 while not done repeat
done:=
- x.i = char " " => false
- x.i = char "__" =>
+ stringChar(x,i) = char " " => false
+ stringChar(x,i) = char "__" =>
esc:=true
true
true
diff --git a/src/interp/record.boot b/src/interp/record.boot
index 5c7ad58c..c23be9ee 100644
--- a/src/interp/record.boot
+++ b/src/interp/record.boot
@@ -237,14 +237,14 @@ htFile2InputFile(pathname,:option) ==
htCommandToInputLine s == fn(s,0) where fn(s,init) ==
--similar to htTrimAtBackSlash except removes all \
- k := or/[i for i in init..maxIndex s | s.i = char "\"] =>
+ k := or/[i for i in init..maxIndex s | stringChar(s,i) = char "\"] =>
member(s.(k + 1),[char "f",char "b"]) => subString(s,init,k - init)
strconc(subString(s,init,k - init),fn(s,k + 1))
subString(s,init)
htTrimAtBackSlash s ==
backslash := char "\"
- k := or/[i for i in 0..maxIndex s | s.i = backslash
+ k := or/[i for i in 0..maxIndex s | stringChar(s,i) = backslash
and member(s.(i + 1),[char "f",char "b"])] => subString(s,0,k - 1)
s
@@ -267,7 +267,7 @@ recordAndPrintTest md == --called by recordAndPrint
string? $currentLine => [$currentLine]
fn $currentLine where fn x ==
x is [y,:r] =>
- y.(k := maxIndex y) = char "__" =>
+ stringChar(y,k := maxIndex y) = char "__" =>
u := fn r
[strconc(subString(y,0,k),'" ",first u),:rest u]
[y,:fn r]
diff --git a/src/interp/word.boot b/src/interp/word.boot
index ab749561..f2bbed07 100644
--- a/src/interp/word.boot
+++ b/src/interp/word.boot
@@ -108,7 +108,7 @@ wordsOfString(s) == [UPCASE x for x in wordsOfStringKeepCase s]
wordsOfStringKeepCase s == wordsOfString1(s,0) or [COPY s]
wordsOfString1(s,j) ==
- k := or/[i for i in j..(maxIndex(s)-1) | isBreakCharacter s.i] =>
+ k := or/[i for i in j..(maxIndex(s)-1) | isBreakCharacter stringChar(s,i)] =>
tailWords:=
isBreakCharacter s.(k+1) =>
n:= or/[i for i in (k+2)..(maxIndex(s)-1)|not isBreakCharacter s.i]
@@ -196,7 +196,7 @@ bootSearch word ==
list :=
hasWildCard? key =>
pattern := patternTran key -- converts * to &
- pattern.0 ~= '_& =>
+ pattern.0 ~= char "&" =>
[x for [x,:.] in HGET($functionTable,UPCASE pattern.0)|
match?(pattern,COPY x)]
"append"/[[x for [x,:.] in HGET($functionTable,k)| match?(pattern,COPY x)]