aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/as.boot18
-rw-r--r--src/interp/br-con.boot14
-rw-r--r--src/interp/br-data.boot34
-rw-r--r--src/interp/br-op1.boot30
-rw-r--r--src/interp/br-op2.boot4
-rw-r--r--src/interp/br-prof.boot2
-rw-r--r--src/interp/br-saturn.boot22
-rw-r--r--src/interp/br-util.boot2
-rw-r--r--src/interp/c-doc.boot10
-rw-r--r--src/interp/c-util.boot2
-rw-r--r--src/interp/category.boot8
-rw-r--r--src/interp/cattable.boot24
-rw-r--r--src/interp/clam.boot64
-rw-r--r--src/interp/clammed.boot4
-rw-r--r--src/interp/compiler.boot4
-rw-r--r--src/interp/compress.boot8
-rw-r--r--src/interp/cparse.boot16
-rw-r--r--src/interp/cstream.boot4
-rw-r--r--src/interp/database.boot8
-rw-r--r--src/interp/define.boot16
-rw-r--r--src/interp/dq.boot10
-rw-r--r--src/interp/format.boot10
-rw-r--r--src/interp/fortcall.boot14
-rw-r--r--src/interp/functor.boot34
-rw-r--r--src/interp/g-boot.boot52
-rw-r--r--src/interp/g-opt.boot4
-rw-r--r--src/interp/g-timer.boot10
-rw-r--r--src/interp/g-util.boot18
-rw-r--r--src/interp/guess.boot14
-rw-r--r--src/interp/hashcode.boot2
-rw-r--r--src/interp/ht-util.boot14
-rw-r--r--src/interp/i-analy.boot26
-rw-r--r--src/interp/i-coerce.boot84
-rw-r--r--src/interp/i-coerfn.boot22
-rw-r--r--src/interp/i-eval.boot6
-rw-r--r--src/interp/i-funsel.boot202
-rw-r--r--src/interp/i-intern.boot12
-rw-r--r--src/interp/i-map.boot54
-rw-r--r--src/interp/i-object.boot10
-rw-r--r--src/interp/i-output.boot22
-rw-r--r--src/interp/i-resolv.boot74
-rw-r--r--src/interp/i-spec1.boot32
-rw-r--r--src/interp/i-spec2.boot24
-rw-r--r--src/interp/i-syscmd.boot132
-rw-r--r--src/interp/i-toplev.boot2
-rw-r--r--src/interp/i-util.boot10
-rw-r--r--src/interp/incl.boot16
-rw-r--r--src/interp/int-top.boot26
-rw-r--r--src/interp/interop.boot74
-rw-r--r--src/interp/intfile.boot10
-rw-r--r--src/interp/lisplib.boot26
-rw-r--r--src/interp/macex.boot2
-rw-r--r--src/interp/mark.boot92
-rw-r--r--src/interp/modemap.boot4
-rw-r--r--src/interp/msg.boot22
-rw-r--r--src/interp/msgdb.boot40
-rw-r--r--src/interp/newfort.boot6
-rw-r--r--src/interp/nrunfast.boot38
-rw-r--r--src/interp/nrungo.boot10
-rw-r--r--src/interp/nrunopt.boot26
-rw-r--r--src/interp/packtran.boot4
-rw-r--r--src/interp/pf2atree.boot18
-rw-r--r--src/interp/pf2sex.boot4
-rw-r--r--src/interp/pile.boot10
-rw-r--r--src/interp/profile.boot2
-rw-r--r--src/interp/pspad1.boot8
-rw-r--r--src/interp/pspad2.boot10
-rw-r--r--src/interp/rulesets.boot2
-rw-r--r--src/interp/scan.boot8
-rw-r--r--src/interp/server.boot2
-rw-r--r--src/interp/setvars.boot6
-rw-r--r--src/interp/sfsfun.boot6
-rw-r--r--src/interp/showimp.boot24
-rw-r--r--src/interp/slam.boot4
-rw-r--r--src/interp/termrw.boot34
-rw-r--r--src/interp/topics.boot6
-rw-r--r--src/interp/trace.boot18
-rw-r--r--src/interp/wi1.boot10
-rw-r--r--src/interp/wi2.boot20
-rw-r--r--src/interp/word.boot2
80 files changed, 889 insertions, 889 deletions
diff --git a/src/interp/as.boot b/src/interp/as.boot
index b6c7a2d2..a167c97e 100644
--- a/src/interp/as.boot
+++ b/src/interp/as.boot
@@ -149,7 +149,7 @@ asMakeAlist con ==
--children:= mySort HGET($childrenHash,con)
alists := HGET($opHash,con)
opAlist := SUBLISLIS($FormalMapVariableList,KDR form,CDDR alists)
- ancestorAlist:= SUBLISLIS($FormalMapVariableList,KDR form,CAR alists)
+ ancestorAlist:= SUBLISLIS($FormalMapVariableList,KDR form,first alists)
catAttrs := [[x,:true] for x in getAttributesFromCATEGORY $constructorCategory]
attributeAlist := REMDUP [:second alists,:catAttrs]
documentation :=
@@ -556,12 +556,12 @@ asytranApply(['Apply,name,:arglist],levels,local?) ==
[name,:[asytranApplySpecial(x, levels, local?) for x in arglist]]
null arglist => [name]
name is [ 'RestrictTo, :.] =>
- asytranApply(['Apply, CAR CDR name,:arglist], levels, local?)
+ asytranApply(['Apply, first rest name,:arglist], levels, local?)
name is [ 'Qualify, :.] =>
- asytranApply(['Apply, CAR CDR name,:arglist], levels, local?)
- name is 'string => asytranLiteral CAR arglist
- name is 'integer => asytranLiteral CAR arglist
- name is 'float => asytranLiteral CAR arglist
+ asytranApply(['Apply, first rest name,:arglist], levels, local?)
+ name is 'string => asytranLiteral first arglist
+ name is 'integer => asytranLiteral first arglist
+ name is 'float => asytranLiteral first arglist
name = 'Enumeration =>
["Enumeration",:[asytranEnumItem arg for arg in arglist]]
[:argl,lastArg] := arglist
@@ -569,7 +569,7 @@ asytranApply(['Apply,name,:arglist],levels,local?) ==
asytranFormSpecial(lastArg,levels,false)]
asytranLiteral(lit) ==
- CAR CDR lit
+ first rest lit
asytranEnumItem arg ==
arg is ['Declare, name, :.] => name
@@ -872,7 +872,7 @@ asyTypeJoin r ==
conpart := asyTypeJoinStack REVERSE $conStack
conpart =>
catpart => ['Join,:conpart,catpart]
- CDR conpart => ['Join,:conpart]
+ rest conpart => ['Join,:conpart]
conpart
catpart
@@ -974,7 +974,7 @@ asyFindAttrs l ==
notattrs := []
for x in l repeat
x0 := x
- while CONSP x repeat x := CAR x
+ while CONSP x repeat x := first x
if MEMQ(x, $BuiltinAttributes) then attrs := [:attrs, x]
else notattrs := [:notattrs, x0]
[attrs, notattrs]
diff --git a/src/interp/br-con.boot b/src/interp/br-con.boot
index 39813330..b283b02b 100644
--- a/src/interp/br-con.boot
+++ b/src/interp/br-con.boot
@@ -265,9 +265,9 @@ domainDescendantsOf(conform,domform) == main where --called by kargPage
keepList := nil
for [item,:pred] in domainsOf(x,IFCAR domlist) repeat
u := assoc(item,alist) =>
- keepList := [[item,:quickAnd(CDR u,pred)],:keepList]
+ keepList := [[item,:quickAnd(rest u,pred)],:keepList]
alist := keepList
- for pair in alist repeat RPLACD(pair,simpHasPred CDR pair)
+ for pair in alist repeat RPLACD(pair,simpHasPred rest pair)
listSort(function GLESSEQP, alist)
catScreen(r,alist) ==
for x in r repeat
@@ -306,7 +306,7 @@ kePage(htPage,junk) ==
getConstructorExports((domname or conform),true))
[conlist,attrlist,:oplist] := data
if domname then
- for x in conlist repeat RPLAC(CDR x,simpHasPred CDR x)
+ for x in conlist repeat RPLAC(rest x,simpHasPred rest x)
for x in attrlist repeat RPLAC(CDDR x,simpHasPred CDDR x)
for x in oplist repeat RPLAC(CDDR x,simpHasPred CDDR x)
prefix := pluralSay(#conlist + #attrlist + #oplist,'"Export",'"Exports")
@@ -510,7 +510,7 @@ kcpPage(htPage,junk) ==
reduceAlistForDomain(alist,domform,conform) == --called from kccPage
alist := SUBLISLIS(rest domform,rest conform,alist)
- for pair in alist repeat RPLACD(pair,simpHasPred(CDR pair,domform))
+ for pair in alist repeat RPLACD(pair,simpHasPred(rest pair,domform))
[pair for (pair := [.,:pred]) in alist | pred]
kcaPage(htPage,junk) ==
@@ -884,10 +884,10 @@ dbGetDocTable(op,$sig,docTable,$which,aux) == main where
[origin,:doc]
or/[gn x for x in HGET(docTable,op)]
gn u == --u is [origin,entry1,...,:code]
- $conform := CAR u --origin
+ $conform := first u --origin
if ATOM $conform then $conform := [$conform]
code := LASTATOM u --optional topic code
- comments := or/[p for entry in CDR u | p := hn entry] or return nil
+ comments := or/[p for entry in rest u | p := hn entry] or return nil
[$conform,first comments,:code]
hn [sig,:doc] ==
$which = '"attribute" => sig is ['attribute,: =$sig] and doc
@@ -959,7 +959,7 @@ conPageChoose conname ==
dbShowCons1(htPage,cAlist,key) ==
conlist := REMDUP [item for x in cAlist | pred] where
pred() ==
- item := CAR x
+ item := first x
$exposedOnlyIfTrue => isExposedConstructor opOf item
item
--$searchFirstTime and (conlist is [.]) => conPage first conlist
diff --git a/src/interp/br-data.boot b/src/interp/br-data.boot
index 8f513175..cd7d955d 100644
--- a/src/interp/br-data.boot
+++ b/src/interp/br-data.boot
@@ -36,7 +36,7 @@ import bc_-util
namespace BOOT
lefts u ==
- [x for x in HKEYS _*HASCATEGORY_-HASH_* | CDR x = u]
+ [x for x in HKEYS _*HASCATEGORY_-HASH_* | rest x = u]
@@ -234,11 +234,11 @@ dbAugmentConstructorDataTable() ==
cname := INTERN dbName line
entry := getCDTEntry(cname,true) => --skip over Mapping, Union, Record
[name,abb,:.] := entry
- RPLACD(CDR entry,PUTALIST(CDDR entry,'dbLineNumber,fp))
+ RPLACD(rest entry,PUTALIST(CDDR entry,'dbLineNumber,fp))
-- if xname := constructorHasExamplePage entry then
--- RPLACD(CDR entry,PUTALIST(CDDR entry,'dbExampleFile,xname))
+-- RPLACD(rest entry,PUTALIST(CDDR entry,'dbExampleFile,xname))
args := IFCDR getConstructorFormFromDB name
- if args then RPLACD(CDR entry,PUTALIST(CDDR entry,'constructorArgs,args))
+ if args then RPLACD(rest entry,PUTALIST(CDDR entry,'constructorArgs,args))
'done
dbHasExamplePage conname ==
@@ -476,7 +476,7 @@ getImports conname == --called by mkUsersHashTable
and not (op in '(Mapping Union Record Enumeration CONS QUOTE local))
doImport(x,template) ==
x is [op,:args] =>
- op = 'QUOTE or op = 'NRTEVAL => CAR args
+ op = 'QUOTE or op = 'NRTEVAL => first args
op = 'local => first args
op = 'Record =>
['Record,:[[":",second y,doImport(third y,template)] for y in args]]
@@ -578,8 +578,8 @@ childrenOf conform ==
childAssoc(conform,parentsOfForm first pair)]
childAssoc(form,alist) ==
- null (argl := CDR form) => assoc(form,alist)
- u := assocCar(opOf form, alist) => childArgCheck(argl,rest CAR u) and u
+ null (argl := rest form) => assoc(form,alist)
+ u := assocCar(opOf form, alist) => childArgCheck(argl,rest first u) and u
nil
assocCar(x, al) == or/[pair for pair in al | x = CAAR pair]
@@ -651,7 +651,7 @@ ancestorsAdd(pred,form) == --called by ancestorsRecur
op := IFCAR form or form
alist := HGET($if,op)
existingNode := assoc(form,alist) =>
- RPLACD(existingNode,quickOr(CDR existingNode,pred))
+ RPLACD(existingNode,quickOr(rest existingNode,pred))
HPUT($if,op,[[form,:pred],:alist])
domainsOf(conform,domname,:options) ==
@@ -662,7 +662,7 @@ domainsOf(conform,domname,:options) ==
--u is list of pairs (a . b) where b() = conname
--we sort u then replace each b by the predicate for which this is true
s := listSort(function GLESSEQP,COPY u)
- s := [[CAR pair,:constructorHasCategoryFromDB pair] for pair in s]
+ s := [[first pair,:constructorHasCategoryFromDB pair] for pair in s]
transKCatAlist(conform,domname,listSort(function GLESSEQP,s))
catsOf(conform,domname,:options) ==
@@ -685,8 +685,8 @@ transKCatAlist(conform,domname,s) == main where
acc := nil
rest conform =>
for pair in s repeat --pair has form [con,[conargs,:pred],...]]
- leftForm := getConstructorForm CAR pair
- for (ap := [args,:pred]) in CDR pair repeat
+ leftForm := getConstructorForm first pair
+ for (ap := [args,:pred]) in rest pair repeat
match? :=
domargs = args => true
HAS__SHARP__VAR args => domargs = sublisFormal(KDR domname,args)
@@ -697,17 +697,17 @@ transKCatAlist(conform,domname,s) == main where
NREVERSE acc
--conform has no arguments so each pair has form [con,:pred]
for pair in s repeat
- leftForm := getConstructorForm CAR pair or systemError nil
+ leftForm := getConstructorForm first pair or systemError nil
RPLACA(pair,leftForm)
- RPLACD(pair,sublisFormal(KDR leftForm,CDR pair))
+ RPLACD(pair,sublisFormal(KDR leftForm,rest pair))
s
--no domname, so look for special argument combinations
acc := nil
KDR conform =>
farglist := TAKE(#rest conform,$FormalMapVariableList)
for pair in s repeat --pair has form [con,[conargs,:pred],...]]
- leftForm := getConstructorForm CAR pair
- for (ap := [args,:pred]) in CDR pair repeat
+ leftForm := getConstructorForm first pair
+ for (ap := [args,:pred]) in rest pair repeat
hasArgsForm? := args ~= farglist
npred := sublisFormal(KDR leftForm,pred)
if hasArgsForm? then
@@ -719,9 +719,9 @@ transKCatAlist(conform,domname,s) == main where
acc := [[leftForm,:npred],:acc]
NREVERSE acc
for pair in s repeat --pair has form [con,:pred]
- leftForm := getConstructorForm CAR pair
+ leftForm := getConstructorForm first pair
RPLACA(pair,leftForm)
- RPLACD(pair,sublisFormal(KDR leftForm,CDR pair))
+ RPLACD(pair,sublisFormal(KDR leftForm,rest pair))
s
mkHasArgsPred subargs ==
diff --git a/src/interp/br-op1.boot b/src/interp/br-op1.boot
index e3f17e52..eb827bd1 100644
--- a/src/interp/br-op1.boot
+++ b/src/interp/br-op1.boot
@@ -366,14 +366,14 @@ dbGatherData(htPage,opAlist,which,key) ==
nil
newEntry :=
u := assoc(entry,data) => --key seen before? look on DATA
- RPLACA(CDR u,second u or exposeFlag)--yes, expose if any 1 is exposed
+ RPLACA(rest u,second u or exposeFlag)--yes, expose if any 1 is exposed
u
data := [y := [entry,exposeFlag,:tail],:data]
y --no, create new entry in DATA
if member(key,'(origins conditions)) then
r := CDDR newEntry
if atom r then r := nil --clear out possible 'ASCONST
- RPLACD(CDR newEntry, --store op/sigs under key if needed
+ RPLACD(rest newEntry, --store op/sigs under key if needed
insert([dbMakeSignature(op,item),exposeFlag,:tail],r))
if member(key,'(origins conditions)) then
for entry in data repeat --sort list of entries (after the 2nd)
@@ -381,7 +381,7 @@ dbGatherData(htPage,opAlist,which,key) ==
tail :=
atom tail => tail
listSort(function LEXLESSEQP,tail)
- RPLACD(CDR entry,tail)
+ RPLACD(rest entry,tail)
data := listSort(function LEXLESSEQP,data)
data
@@ -414,12 +414,12 @@ dbGatherDataImplementation(htPage,opAlist) ==
while u repeat
key := CDDAR u --implementor
entries :=
- [[CAR u,true],:[u and [CAR u,true] while key = CDDAR (u := rest u)]]
+ [[first u,true],:[u and [first u,true] while key = CDDAR (u := rest u)]]
alist := [[key,gn key,:entries],:alist]
NREVERSE alist
gn key ==
atom key => true
- isExposedConstructor CAR key
+ isExposedConstructor first key
dbSelectData(htPage,opAlist,key) ==
branch := htpProperty(htPage,'branch)
@@ -435,10 +435,10 @@ dbSelectData(htPage,opAlist,key) ==
dbReduceOpAlist(opAlist,data,branch) ==
branch = 'signatures => dbReduceBySignature(opAlist,CAAR data,CADAR data)
- branch = 'origins => dbReduceBySelection(opAlist,CAR data,function third)
- branch = 'conditions => dbReduceBySelection(opAlist,CAR data,function second)
+ branch = 'origins => dbReduceBySelection(opAlist,first data,function third)
+ branch = 'conditions => dbReduceBySelection(opAlist,first data,function second)
branch = 'implementation => dbReduceByOpSignature(opAlist,CDDR data)
- branch = 'parameters => dbReduceByForm(opAlist,CAR data)
+ branch = 'parameters => dbReduceByForm(opAlist,first data)
systemError ['"Unexpected branch: ",branch]
dbReduceByOpSignature(opAlist,datalist) ==
@@ -524,7 +524,7 @@ dbShowOpAllDomains(htPage,opAlist,which) ==
domOriginAlist := nil --list of domain origins
for [op,:items] in opAlist repeat
for [.,predicate,origin,:.] in items repeat
- conname := CAR origin
+ conname := first origin
getConstructorKindFromDB conname = "category" =>
pred := simpOrDumb(predicate,LASSQ(conname,catOriginAlist) or true)
catOriginAlist := insertAlist(conname,pred,catOriginAlist)
@@ -562,7 +562,7 @@ dbShowOpConditions(htPage,opAlist,which,data) ==
dbGatherThenShow(htPage,opAlist,which,data,nil,nil,function bcPred)
dbShowKind conform ==
- conname := CAR conform
+ conname := first conform
kind := getConstructorKindFromDB conname
kind = "domain" =>
(s := PNAME conname).(MAXINDEX s) = '_& => '"default package"
@@ -735,7 +735,7 @@ reduceOpAlistForDomain(opAlist,domform,conform) ==
for pair in opAlist repeat
RPLACD(pair,[test for item in rest pair | test]) where test() ==
[head,:tail] := item
- CAR tail = true => item
+ first tail = true => item
pred := simpHasPred SUBLISLIS(form1,form2,QCAR tail)
null pred => false
RPLACD(item,[pred])
@@ -852,7 +852,7 @@ dbExpandOpAlistIfNecessary(htPage,opAlist,which,needOrigins?,condition?) ==
for [op,:alist] in opAlist repeat
for [sig,:tail] in alist repeat
condition? => --the only purpose here is to find a non-trivial pred
- null atom (pred := CAR tail) => return ($value := pred)
+ null atom (pred := first tail) => return ($value := pred)
'skip
u :=
tail is [.,origin,:.] and origin =>
@@ -863,7 +863,7 @@ dbExpandOpAlistIfNecessary(htPage,opAlist,which,needOrigins?,condition?) ==
dbGetDocTable(op,sig,docTable,which,nil)
origin := IFCAR u or origin
docCode := IFCDR u --> (doc . code)
--- if null FIXP CDR docCode then harhar(op) -->
+-- if null FIXP rest docCode then harhar(op) -->
if null doc and which = '"attribute" then doc := getRegistry(op,sig)
RPLACD(tail,[origin,isExposedConstructor opOf origin,:docCode])
$value => return $value
@@ -931,7 +931,7 @@ getDomainOpTable(dom,fromIfTrue,:options) ==
$predEvalAlist : local := nil
$returnNowhereFromGoGet: local := true
domname := dom.0
- conname := CAR domname
+ conname := first domname
abb := getConstructorAbbreviation conname
opAlist := getOperationAlistFromLisplib conname
"append"/[REMDUP [[op1,:fn] for [sig,slot,pred,key,:.] in u
@@ -954,7 +954,7 @@ getDomainOpTable(dom,fromIfTrue,:options) ==
f = 'nowhere => 'nowhere --see replaceGoGetSlot
f = 'makeSpadConstant => 'constant
f = function IDENTITY => 'constant
- f = 'newGoGet => substitute('_$,domname,devaluate CAR r)
+ f = 'newGoGet => substitute('_$,domname,devaluate first r)
null VECP r => systemError devaluateList r
substitute('_$,domname,devaluate r)
'nowhere
diff --git a/src/interp/br-op2.boot b/src/interp/br-op2.boot
index d1f7e888..925e1109 100644
--- a/src/interp/br-op2.boot
+++ b/src/interp/br-op2.boot
@@ -421,7 +421,7 @@ zeroOneConvert x ==
kFormatSlotDomain x == fn formatSlotDomain x where fn x ==
atom x => x
- (op := CAR x) = '_$ => '_$
+ (op := first x) = '_$ => '_$
op = 'local => second x
op = ":" => [":",second x,fn third x]
isConstructorName op => [fn y for y in x]
@@ -459,7 +459,7 @@ hashTable2Alist tb ==
[[op,:HGET(tb,op)] for op in listSort(function GLESSEQP,HKEYS $if)]
koCatAttrsAdd(catform,pred) ==
- for [name,argl,:p] in CAR getConstructorExports catform repeat
+ for [name,argl,:p] in first getConstructorExports catform repeat
npred := quickAnd(pred,p)
exists := HGET($if,name)
if existingPred := LASSOC(argl,exists)_
diff --git a/src/interp/br-prof.boot b/src/interp/br-prof.boot
index 63bef4d7..02ce10ee 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 =>
- [INTERN STRCONC(PNAME conname,'"&"),"$",:CDR conform]
+ [INTERN STRCONC(PNAME conname,'"&"),"$",:rest conform]
conform
faTypes := CDDAR getConstructorModemapFromDB conname
diff --git a/src/interp/br-saturn.boot b/src/interp/br-saturn.boot
index c482c72d..21813a35 100644
--- a/src/interp/br-saturn.boot
+++ b/src/interp/br-saturn.boot
@@ -480,7 +480,7 @@ htSayHrule() == bcHt
htDoneButton(func, htPage, :optionalArgs) ==
------> Handle argument values passed from page if present
if optionalArgs ~= nil then
- htpSetInputAreaAlist(htPage,CAR optionalArgs)
+ htpSetInputAreaAlist(htPage,first optionalArgs)
typeCheckInputAreas htPage =>
htMakeErrorPage htPage
not FBOUNDP func =>
@@ -741,7 +741,7 @@ kPageContextMenuSaturn page ==
saturnExampleLink lname ==
htSay '"\docLink{\csname "
- htSay STRCONC(CAR(CDR(lname)), '"\endcsname}{E&xamples}")
+ htSay STRCONC(first(rest(lname)), '"\endcsname}{E&xamples}")
$exampleConstructors := nil
@@ -763,7 +763,7 @@ dbPresentCons(htPage,kind,:exclusions) ==
htpSetProperty(htPage,'exclusion,first exclusions)
cAlist := htpProperty(htPage,'cAlist)
empty? := null cAlist
- one? := null CDR cAlist
+ one? := null rest cAlist
one? := empty? or one?
exposedUnexposedFlag := $includeUnexposed? --used to be star? 4/92
star? := true --always include information on exposed/unexposed 4/92
@@ -773,7 +773,7 @@ dbPresentCons(htPage,kind,:exclusions) ==
then htSay '"{\em Abbreviations}"
else htMakePage [['bcLispLinks,['"Abbreviations",'"",'dbShowCons,'abbrs]]]
htSay '"}{"
- if one? or member('conditions,exclusions) or "and"/[CDR x = true for x in cAlist]
+ if one? or member('conditions,exclusions) or "and"/[rest x = true for x in cAlist]
then htSay '"{\em Conditions}"
else htMakePage [['bcLispLinks,['"Conditions",'"",'dbShowCons,'conditions]]]
htSay '"}{"
@@ -781,7 +781,7 @@ dbPresentCons(htPage,kind,:exclusions) ==
then htSay '"{\em Descriptions}"
else htMakePage [['bcLispLinks,['"Descriptions",'"",'dbShowCons,'documentation]]]
htSay '"}{"
- if one? or null CDR cAlist
+ if one? or null rest cAlist
then htSay '"{\em Filter}"
else htMakePage
[['bcLinks,['"Filter",'"",'htFilterPage,['dbShowCons,'filter]]]]
@@ -824,13 +824,13 @@ dbPresentConsSaturn(htPage,kind,exclusions) ==
if one? or member('abbrs,exclusions)
then htSayCold '"\&Abbreviations"
else htMakePage [['bcLispLinks,['"\&Abbreviations",'"",'dbShowCons,'abbrs]]]
- if one? or member('conditions,exclusions) or "and"/[CDR x = true for x in cAlist]
+ if one? or member('conditions,exclusions) or "and"/[rest x = true for x in cAlist]
then htSayCold '"\&Conditions"
else htMakePage [['bcLispLinks,['"\&Conditions",'"",'dbShowCons,'conditions]]]
if empty? or member('documentation,exclusions)
then htSayCold '"\&Descriptions"
else htMakePage [['bcLispLinks,['"\&Descriptions",'"",'dbShowCons,'documentation]]]
- if one? or null CDR cAlist
+ if one? or null rest cAlist
then htSayCold '"\&Filter"
else htMakeSaturnFilterPage ['dbShowCons, 'filter]
if one? or member('kinds,exclusions) or kind ~= 'constructor
@@ -917,10 +917,10 @@ addParameterTemplates(page, conform) ==
htSaySaturn '"\colorbuttonbox{lightgray}{"
htSay '"Optional argument value"
htSay
- CDR parlist => '"s:"
+ rest parlist => '"s:"
'":"
htSaySaturn '"}"
- if CDR conform then htSaySaturn '"\newline{}"
+ if rest conform then htSaySaturn '"\newline{}"
htSaySaturn '"\begin{tabular}{p{.25in}l}"
firstTime := true
odd := false
@@ -1380,7 +1380,7 @@ displayDomainOp(htPage,which,origin,op,sig,predicate,
htSaySaturnAmpersand()
htSayIndentRel(15)
htSay '"\spadref{"
- htSay CAR(CDR(link))
+ htSay first(rest(link))
htSay '"}"
htSayIndentRel(-15)
htSayStandard('"\newline{}")
@@ -1426,7 +1426,7 @@ htEndTabular() ==
htPopSaturn s ==
pageDescription := ELT($saturnPage, 7)
- pageDescription is [=s,:b] => SETELT($saturnPage, 7, CDR pageDescription)
+ pageDescription is [=s,:b] => SETELT($saturnPage, 7, rest pageDescription)
nil
htBeginTable() ==
diff --git a/src/interp/br-util.boot b/src/interp/br-util.boot
index ca0e004d..8ab7c4ec 100644
--- a/src/interp/br-util.boot
+++ b/src/interp/br-util.boot
@@ -278,7 +278,7 @@ getConstructorForm name ==
name = 'Enumeration => '(Enumeration a b)
getConstructorFormFromDB name
-getConstructorArgs conname == CDR getConstructorForm conname
+getConstructorArgs conname == rest getConstructorForm conname
bcComments(comments,:options) ==
italics? := not IFCAR options
diff --git a/src/interp/c-doc.boot b/src/interp/c-doc.boot
index 131897fd..cf42a4ad 100644
--- a/src/interp/c-doc.boot
+++ b/src/interp/c-doc.boot
@@ -102,7 +102,7 @@ recordDocumentation(key,lineno) ==
--record NIL to mean "there was no documentation"
$maxSignatureLineNumber := lineno
$docList := [[key,:u],:$docList]
- -- leave CAR of $docList alone as required by collectAndDeleteAssoc
+ -- leave first of $docList alone as required by collectAndDeleteAssoc
recordHeaderDocumentation lineno ==
if $maxSignatureLineNumber = 0 then
@@ -139,7 +139,7 @@ finalizeDocumentation() ==
y is [x,b] and b is [='attribute,:r] =>
attributes := [[x,:r],:attributes]
signatures := [y,:signatures]
- name := CAR $lisplibForm
+ name := first $lisplibForm
if noHeading or signatures or attributes or unusedCommentLineNumbers then
sayKeyedMsg("S2CD0001",NIL)
bigcnt := 1
@@ -1005,7 +1005,7 @@ checkBalance u ==
do
x := first u
openClose := assoc(x,$checkPrenAlist) --is it an open bracket?
- => stack := [CAR openClose,:stack] --yes, push the open bracket
+ => stack := [first openClose,:stack] --yes, push the open bracket
open := rassoc(x,$checkPrenAlist) => --it is a close bracket!
stack is [top,:restStack] => --does corresponding open bracket match?
if open ~= top then --yes: just pop the stack
@@ -1042,7 +1042,7 @@ checkBeginEnd u ==
x = '"\beginitems" =>
beginEndStack := ["items",:beginEndStack]
x = '"\begin" =>
- u is [.,=$charLbrace,y,:r] and CAR r = $charRbrace =>
+ u is [.,=$charLbrace,y,:r] and first r = $charRbrace =>
if not member(y,$beginEndList) then
checkDocError ['"Unknown begin type: \begin{",y,'"}"]
beginEndStack := [y,:beginEndStack]
@@ -1054,7 +1054,7 @@ checkBeginEnd u ==
checkDocError ['"\item appears outside a \begin-\end"]
checkDocError ['"\item appears within a \begin{",IFCAR beginEndStack,'"}.."]
x = '"\end" =>
- u is [.,=$charLbrace,y,:r] and CAR r = $charRbrace =>
+ u is [.,=$charLbrace,y,:r] and first r = $charRbrace =>
y = IFCAR beginEndStack =>
beginEndStack := rest beginEndStack
u := r
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 5afcd2be..863f6d38 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -567,7 +567,7 @@ isDomainInScope(domain,e) ==
false
(name:= first domain)="Category" => true
ASSQ(name,domainList) => true
--- null CDR domain or domainMember(domain,domainList) => true
+-- null rest domain or domainMember(domain,domainList) => true
-- false
isFunctor name => false
true --is not a functor
diff --git a/src/interp/category.boot b/src/interp/category.boot
index a078366b..4b370f0e 100644
--- a/src/interp/category.boot
+++ b/src/interp/category.boot
@@ -186,7 +186,7 @@ SigListUnion(extra,original) ==
original:= delete(x,original)
[xsig,xpred,:ximplem]:= x
-- if xsig ~= esig then -- not quite strong enough
- if CAR xsig ~= CAR esig or second xsig ~= second esig then
+ if first xsig ~= first esig or second xsig ~= second esig then
-- the new version won't get confused by "constant"markers
if ximplem is [["Subsumed",:.],:.] then
original := [x,:original]
@@ -195,7 +195,7 @@ SigListUnion(extra,original) ==
else epred:=mkOr(epred,xpred)
-- this used always to be done, as noted below, but that's not safe
if not(ximplem is [["Subsumed",:.],:.]) then eimplem:= ximplem
- if eimplem then esig:=[CAR esig,second esig]
+ if eimplem then esig:=[first esig,second esig]
-- in case there's a constant marker
e:= [esig,epred,:eimplem]
-- e:= [esig,mkOr(xpred,epred),:ximplem]
@@ -336,7 +336,7 @@ FindFundAncs l ==
x:= ASSQ(first u,ans) =>
ans:= [[first u,mkOr(second x,second u)],:delete(x,ans)]
ans:= [u,:ans]
- --testing to see if CAR l is already there
+ --testing to see if first l is already there
x:= ASSQ(CAAR l,ans) => [[CAAR l,mkOr(CADAR l,second x)],:delete(x,ans)]
CADAR l=true =>
for x in first f1.4 repeat if y:= ASSQ(CatEval x,ans) then ans:= delete(y,ans)
@@ -492,7 +492,7 @@ JoinInner(l,$e) ==
-- SAY("adding a conditional domain ",
-- bname,
-- " replacing",
- -- CAR anc)
+ -- first anc)
bCond:= ASSQ(b,CondList)
CondList:= delete(bCond,CondList)
-- value of bCond not used and could be NIL
diff --git a/src/interp/cattable.boot b/src/interp/cattable.boot
index 78831c76..dab21ee3 100644
--- a/src/interp/cattable.boot
+++ b/src/interp/cattable.boot
@@ -96,12 +96,12 @@ simpHasPred(pred,:options) == main where
simp pred ==
pred is [op,:r] =>
op = "has" => simpHas(pred,first r,first rest r)
- op = 'HasCategory => simp ["has",CAR r,simpDevaluate second r]
+ op = 'HasCategory => simp ["has",first r,simpDevaluate second r]
op = 'HasSignature =>
[op,sig] := simpDevaluate second r
- ["has",CAR r,['SIGNATURE,op,sig]]
+ ["has",first r,['SIGNATURE,op,sig]]
op = 'HasAttribute =>
- form := ["has",a := CAR r,['ATTRIBUTE,b := simpDevaluate second r]]
+ form := ["has",a := first r,['ATTRIBUTE,b := simpDevaluate second r]]
simpHasAttribute(form,a,b)
op in '(AND OR NOT) =>
null (u := MKPF([simp p for p in r],op)) => nil
@@ -124,8 +124,8 @@ simpHasPred(pred,:options) == main where
IDENTP npred or null hasIdent npred => npred
pred
eval (pred := ["has",d,cat]) ==
- x := hasCat(CAR d,CAR cat)
- y := CDR cat =>
+ x := hasCat(first d,first cat)
+ y := rest cat =>
npred := or/[p for [args,:p] in x | y = args] => simp npred
false --if not there, it is false
x
@@ -360,7 +360,7 @@ makeCatPred(zz, cats, thePred) ==
ats := if ats is ['PROGN,:atl] then atl else [ats]
for at in ats repeat
if at is ['ATTRIBUTE,z3] and not atom z3 and
- constructor? CAR z3 then
+ constructor? first z3 then
cats:= CONS(['IF,quickAnd(["has",z1,z2], thePred),z3,'%noBranch],cats)
at is ['IF, pred, :.] =>
cats := makeCatPred(at, cats, curPred)
@@ -438,17 +438,17 @@ squeezeList(l) ==
squeeze1(l) ==
-- recursive version of squeezeList
- x:= CAR l
+ x:= first l
y:=
atom x => x
- z:= member(x,$found) => CAR z
+ z:= member(x,$found) => first z
$found:= CONS(x,$found)
squeeze1 x
RPLACA(l,y)
- x:= CDR l
+ x:= rest l
y:=
atom x => x
- z:= member(x,$found) => CAR z
+ z:= member(x,$found) => first z
$found:= CONS(x,$found)
squeeze1 x
RPLACD(l,y)
@@ -483,7 +483,7 @@ clearCategoryTable($cname) ==
MAPHASH('clearCategoryTable1,_*HASCATEGORY_-HASH_*)
clearCategoryTable1(key,val) ==
- (CAR key=$cname)=> HREM(_*HASCATEGORY_-HASH_*,key)
+ (first key=$cname)=> HREM(_*HASCATEGORY_-HASH_*,key)
nil
clearTempCategoryTable(catNames) ==
@@ -492,7 +492,7 @@ clearTempCategoryTable(catNames) ==
extensions:= nil
for (extension:= [catForm,:.]) in getConstructorAncestorsFromDB key
repeat
- MEMQ(CAR catForm,catNames) => nil
+ MEMQ(first catForm,catNames) => nil
extensions:= [extension,:extensions]
HPUT(_*ANCESTORS_-HASH_*,key,extensions)
diff --git a/src/interp/clam.boot b/src/interp/clam.boot
index 75220181..b5ba0338 100644
--- a/src/interp/clam.boot
+++ b/src/interp/clam.boot
@@ -319,12 +319,12 @@ consForHashLookup(a,b) ==
$hashNode
CDRwithIncrement x ==
- RPLACA(x,QSADD1 CAR x)
- CDR x
+ RPLACA(x,QSADD1 first x)
+ rest x
HGETandCount(hashTable,prop) ==
u:= HGET(hashTable,prop) or return nil
- RPLACA(u,QSADD1 CAR u)
+ RPLACA(u,QSADD1 first u)
u
clearClams() ==
@@ -395,7 +395,7 @@ displayCacheFrequency al ==
mkCircularCountAlist(cl,len) ==
for [x,count,:.] in cl for i in 1..len while x ~= '_$failed repeat
- u:= assoc(count,al) => RPLACD(u,1 + CDR u)
+ u:= assoc(count,al) => RPLACD(u,1 + rest u)
if INTEGERP $reportFavoritesIfNumber and count >= $reportFavoritesIfNumber then
sayBrightlyNT [" ",count," "]
pp x
@@ -412,7 +412,7 @@ reportHashCacheStats fn ==
mkHashCountAlist vl ==
for [count,:.] in vl repeat
- u:= assoc(count,al) => RPLACD(u,1 + CDR u)
+ u:= assoc(count,al) => RPLACD(u,1 + rest u)
al:= [[count,:1],:al]
al
@@ -425,7 +425,7 @@ clearHashReferenceCounts() ==
remHashEntriesWith0Count $hashTable ==
MAPHASH(function fn,$hashTable) where fn(key,obj) ==
- CAR obj = 0 => HREM($hashTable,key) --free store
+ first obj = 0 => HREM($hashTable,key) --free store
nil
initCache n ==
@@ -439,9 +439,9 @@ assocCache(x,cacheName,fn) ==
forwardPointer:= al
val:= nil
until EQ(forwardPointer,al) repeat
- FUNCALL(fn,CAAR forwardPointer,x) => return (val:= CAR forwardPointer)
+ FUNCALL(fn,CAAR forwardPointer,x) => return (val:= first forwardPointer)
backPointer:= forwardPointer
- forwardPointer:= CDR forwardPointer
+ forwardPointer:= rest forwardPointer
val => val
setDynamicBinding(cacheName,backPointer)
nil
@@ -452,13 +452,13 @@ assocCacheShift(x,cacheName,fn) == --like ASSOC except that al is circular
forwardPointer:= al
val:= nil
until EQ(forwardPointer,al) repeat
- FUNCALL(fn, CAR (y:=CAR forwardPointer),x) =>
+ FUNCALL(fn, first (y:=first forwardPointer),x) =>
if not EQ(forwardPointer,al) then --shift referenced entry to front
- RPLACA(forwardPointer,CAR al)
+ RPLACA(forwardPointer,first al)
RPLACA(al,y)
return (val:= y)
backPointer := forwardPointer --CAR is slot replaced on failure
- forwardPointer:= CDR forwardPointer
+ forwardPointer:= rest forwardPointer
val => val
setDynamicBinding(cacheName,backPointer)
nil
@@ -472,17 +472,17 @@ assocCacheShiftCount(x,al,fn) ==
val:= nil
minCount:= 10000 --preset minCount but not newFrontPointer here
until EQ(forwardPointer,al) repeat
- FUNCALL(fn, CAR (y:=CAR forwardPointer),x) =>
+ FUNCALL(fn, first (y:=first forwardPointer),x) =>
newFrontPointer := forwardPointer
RPLAC(second y,QSADD1 second y) --increment use count
return (val:= y)
if QSLESSP(c := second y,minCount) then --initial c is 1 so is true 1st time
minCount := c
newFrontPointer := forwardPointer --CAR is slot replaced on failure
- forwardPointer:= CDR forwardPointer
+ forwardPointer:= rest forwardPointer
if not EQ(newFrontPointer,al) then --shift referenced entry to front
- temp:= CAR newFrontPointer --or entry with smallest count
- RPLACA(newFrontPointer,CAR al)
+ temp:= first newFrontPointer --or entry with smallest count
+ RPLACA(newFrontPointer,first al)
RPLACA(al,temp)
val
@@ -530,7 +530,7 @@ haddProp(ht,op,prop,val) ==
stopTimingProcess 'debug
u:= HGET(ht,op) => --hope that one exists most of the time
assoc(prop,u) => val --value is already there--must = val; exit now
- RPLACD(u,[CAR u,:CDR u])
+ RPLACD(u,[first u,:rest u])
RPLACA(u,[prop,:val])
$op: local := op
listTruncate(u,20) --save at most 20 instantiations
@@ -559,9 +559,9 @@ recordInstantiation1(op,prop,dropIfTrue) ==
null $reportInstantiations => nil
u:= HGET($instantRecord,op) => --hope that one exists most of the time
v := LASSOC(prop,u) =>
- dropIfTrue => RPLAC(CDR v,1+CDR v)
- RPLAC(CAR v,1+CAR v)
- RPLACD(u,[CAR u,:CDR u])
+ dropIfTrue => RPLAC(rest v,1+rest v)
+ RPLAC(first v,1+first v)
+ RPLACD(u,[first u,:rest u])
val :=
dropIfTrue => [0,:1]
[1,:0]
@@ -623,11 +623,11 @@ listTruncate(l,n) ==
lassocShift(x,l) ==
y:= l
while not atom y repeat
- EQUAL(x,CAR QCAR y) => return (result := QCAR y)
+ EQUAL(x,first QCAR y) => return (result := QCAR y)
y:= QCDR y
result =>
if NEQ(y,l) then
- QRPLACA(y,CAR l)
+ QRPLACA(y,first l)
QRPLACA(l,result)
QCDR result
nil
@@ -635,11 +635,11 @@ lassocShift(x,l) ==
lassocShiftWithFunction(x,l,fn) ==
y:= l
while not atom y repeat
- FUNCALL(fn,x,CAR QCAR y) => return (result := QCAR y)
+ FUNCALL(fn,x,first QCAR y) => return (result := QCAR y)
y:= QCDR y
result =>
if NEQ(y,l) then
- QRPLACA(y,CAR l)
+ QRPLACA(y,first l)
QRPLACA(l,result)
QCDR result
nil
@@ -647,25 +647,25 @@ lassocShiftWithFunction(x,l,fn) ==
lassocShiftQ(x,l) ==
y:= l
while not atom y repeat
- EQ(x,CAR CAR y) => return (result := CAR y)
+ EQ(x,first first y) => return (result := first y)
y:= CDR y
result =>
if NEQ(y,l) then
- RPLACA(y,CAR l)
+ RPLACA(y,first l)
RPLACA(l,result)
- CDR result
+ rest result
nil
-- rassocShiftQ(x,l) ==
-- y:= l
-- while not atom y repeat
--- EQ(x,CDR CAR y) => return (result := CAR y)
--- y:= CDR y
+-- EQ(x,rest first y) => return (result := first y)
+-- y:= rest y
-- result =>
-- if NEQ(y,l) then
--- RPLACA(y,CAR l)
+-- RPLACA(y,first l)
-- RPLACA(l,result)
--- CAR result
+-- first result
-- nil
globalHashtableStats(x,sortFn) ==
@@ -694,8 +694,8 @@ rightJustifyString(x,maxWidth) ==
domainEqualList(argl1,argl2) ==
--function used to match argument lists of constructors
while argl1 and argl2 repeat
- item1:= devaluate CAR argl1
- item2:= CAR argl2
+ item1:= devaluate first argl1
+ item2:= first argl2
partsMatch:=
item1 = item2 => true
false
diff --git a/src/interp/clammed.boot b/src/interp/clammed.boot
index 0f84aac3..ad2856ac 100644
--- a/src/interp/clammed.boot
+++ b/src/interp/clammed.boot
@@ -65,7 +65,7 @@ coerceConvertMmSelection(funName,m1,m2) ==
l := selectMms1(funName,m2,[m1],[m1],NIL)
mmS := [[sig,[targ,arg],:pred] for x in l | x is [sig,[.,arg],:pred] and
hasCorrectTarget(m2,sig) and sig is [dc,targ,oarg] and oarg = m1]
- mmS and CAR mmS
+ mmS and first mmS
hasFileProperty(p,id,abbrev) == hasFilePropertyNoCache(p,id,abbrev)
@@ -180,7 +180,7 @@ isLegitimateMode(t,hasPolyMode,polyVarList) ==
listOfDuplicates vl => return false
polyVarList:= union(vl,polyVarList)
hasPolyMode => false
- con := CAR t
+ con := first t
poly? := (con = 'Polynomial or con = 'Expression)
isLegitimateMode(underDomainOf t,poly?,polyVarList)
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 21e76792..17ea9b84 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -539,7 +539,7 @@ compForm2(form is [op,:argl],m,e,modemapList) ==
(v:=assoc([dc,:nsig],modemapList)) and v is [.,[ncond,:.]] then
deleteList:=[u,:deleteList]
if not PredImplies(ncond,cond) then
- newList := [[CAR u,[cond,['ELT,dc,nil]]],:newList]
+ newList := [[first u,[cond,['ELT,dc,nil]]],:newList]
if deleteList then
modemapList := [u for u in modemapList | not MEMQ(u,deleteList)]
-- We can use MEMQ since deleteList was built out of members of modemapList
@@ -849,7 +849,7 @@ setqSingle(id,val,m,E) ==
else form:=
$QuickLet => ["%LET",id,x]
["%LET",id,x,
- (isDomainForm(x,e') => ['ELT,id,0];CAR outputComp(id,e'))]
+ (isDomainForm(x,e') => ['ELT,id,0];first outputComp(id,e'))]
[form,m',e']
assignError(val,m',form,m) ==
diff --git a/src/interp/compress.boot b/src/interp/compress.boot
index a196e3e2..43b7a102 100644
--- a/src/interp/compress.boot
+++ b/src/interp/compress.boot
@@ -49,10 +49,10 @@ minimalise x ==
-- copes with a particular Lucid-ism, God knows why
-- This circular way of doing things is an attempt to deal with Lucid
-- Who may place quoted cells in read-only memory
- z:=min CAR x
- if not EQ(z,CAR x) then RPLACA(x,z)
- z:=min CDR x
- if not EQ(z,CDR x) then RPLACD(x,z)
+ z:=min first x
+ if not EQ(z,first x) then RPLACA(x,z)
+ z:=min rest x
+ if not EQ(z,rest x) then RPLACD(x,z)
HashCheck x
REFVECP x =>
for i in 0..MAXINDEX x repeat
diff --git a/src/interp/cparse.boot b/src/interp/cparse.boot
index 04aee282..cf7856c2 100644
--- a/src/interp/cparse.boot
+++ b/src/interp/cparse.boot
@@ -57,7 +57,7 @@ npParse stream ==
ncSoftError(tokPosn $stok,'S2CY0009, [])
pfWrong(pfDocument ['"stack empty"],pfListOf [])
else
- CAR $stack
+ first $stack
npItem()==
npQualDef() =>
@@ -81,19 +81,19 @@ npFirstTok()==
$stok:=
if null $inputStream
then tokConstruct("ERROR","NOMORE",tokPosn $stok)
- else CAR $inputStream
+ else first $inputStream
$ttok:=tokPart $stok
npNext() ==
- $inputStream := CDR($inputStream)
+ $inputStream := rest($inputStream)
npFirstTok()
npState()==cons($inputStream,$stack)
npRestore(x)==
- $inputStream:=CAR x
+ $inputStream:=first x
npFirstTok()
- $stack:=CDR x
+ $stack:=rest x
true
npPush x==$stack:=CONS(x,$stack)
@@ -105,8 +105,8 @@ npPushId()==
npNext()
npPop1()==
- a:=CAR $stack
- $stack:=CDR $stack
+ a:=first $stack
+ $stack:=rest $stack
a
npPop2()==
@@ -116,7 +116,7 @@ npPop2()==
npPop3()==
a:= third $stack
- RPLACD(CDR $stack,CDDDR $stack)
+ RPLACD(rest $stack,CDDDR $stack)
a
npParenthesized f==
diff --git a/src/interp/cstream.boot b/src/interp/cstream.boot
index 85b2b874..5ada55f1 100644
--- a/src/interp/cstream.boot
+++ b/src/interp/cstream.boot
@@ -43,8 +43,8 @@ StreamNull x==
null x or x is ["nullstream",:.] => true
while x is ["nonnullstream",:.] repeat
st:=APPLY(second x,CDDR x)
- RPLACA(x,CAR st)
- RPLACD(x,CDR st)
+ RPLACA(x,first st)
+ RPLACD(x,rest st)
x is ["nullstream",:.]
Delay(f,x)==cons("nonnullstream",[f,:x])
diff --git a/src/interp/database.boot b/src/interp/database.boot
index 1eefebfd..1ff0b711 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -387,7 +387,7 @@ isDomainSubst u == main where
atom x =>
IDENTP x and MEMQ(x,$PatternVariableList) and (s := findSub(x,alist)) => s
x
- [CAR x,:[fn(y,alist) for y in CDR x]]
+ [first x,:[fn(y,alist) for y in rest x]]
findSub(x,alist) ==
null alist => nil
alist is [['isDomain,y,z],:.] and x = y => z
@@ -484,7 +484,7 @@ moveORsOutside p ==
p is ['AND,:q] =>
q := [moveORsOutside r for r in q]
x := or/[r for r in q | r is ['OR,:s]] =>
- moveORsOutside(['OR,:[['AND,:SUBST(t,x,q)] for t in CDR x]])
+ moveORsOutside(['OR,:[['AND,:SUBST(t,x,q)] for t in rest x]])
['AND,:q]
p
@@ -586,7 +586,7 @@ getSystemModemaps(op,nargs) ==
getInCoreModemaps(modemapList,op,nargs) ==
mml:= LASSOC (op,modemapList) =>
- mml:= CAR mml
+ mml:= first mml
[x for (x:= [[dc,:sig],.]) in mml |
(NUMBERP nargs => nargs=#rest sig; true) and
(cfn := abbreviate (domName := getDomainFromMm x)) and
@@ -703,7 +703,7 @@ getOperationAlistFromLisplib x ==
else RPLACD(s,QCDDR f)
else RPLACD(r,QCDR f)
else RPLACD(first items,f)
- RPLACA(items,addConsDB CAR items)
+ RPLACA(items,addConsDB first items)
u and markUnique u
getOplistForConstructorForm (form := [op,:argl]) ==
diff --git a/src/interp/define.boot b/src/interp/define.boot
index e79d7281..caac81ea 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -499,8 +499,8 @@ compDefineCategory2(form,signature,specialCases,body,m,e,
if $extraParms then
formals:=actuals:=nil
for u in $extraParms repeat
- formals:=[CAR u,:formals]
- actuals:=[MKQ CDR u,:actuals]
+ formals:=[first u,:formals]
+ actuals:=[MKQ rest u,:actuals]
body := ['sublisV,['PAIR,['QUOTE,formals],['LIST,:actuals]],body]
if argl then body:= -- always subst for args after extraparms
['sublisV,['PAIR,['QUOTE,sargl],['LIST,:
@@ -817,7 +817,7 @@ makeFunctorArgumentParameters(argl,sigl,target) ==
-- if we find something extra, add it to the signature
null ss => s
for u in ss repeat
- $ConditionalOperators:=[CDR u,:$ConditionalOperators]
+ $ConditionalOperators:=[rest u,:$ConditionalOperators]
s is ['Join,:sl] =>
u:=ASSQ('CATEGORY,ss) =>
MSUBST([:u,:ss],u,s)
@@ -1326,7 +1326,7 @@ bootStrapError(functorForm,sourceFile) ==
['COND, _
['$bootStrapMode, _
['VECTOR,mkTypeForm functorForm,nil,nil,nil,nil,nil]],
- [''T, ['systemError,['LIST,''%b,MKQ CAR functorForm,''%d,'"from", _
+ [''T, ['systemError,['LIST,''%b,MKQ first functorForm,''%d,'"from", _
''%b,MKQ namestring sourceFile,''%d,'"needs to be compiled"]]]]
compAdd(['add,$addForm,capsule],m,e) ==
@@ -1336,7 +1336,7 @@ compAdd(['add,$addForm,capsule],m,e) ==
[['COND, _
['$bootStrapMode, _
code],_
- [''T, ['systemError,['LIST,''%b,MKQ CAR $functorForm,''%d,'"from", _
+ [''T, ['systemError,['LIST,''%b,MKQ first $functorForm,''%d,'"from", _
''%b,MKQ namestring _/EDITFILE,''%d,'"needs to be compiled"]]]],m,e]
$addFormLhs: local:= $addForm
if $addForm is ["SubDomain",domainForm,predicate] then
@@ -1541,8 +1541,8 @@ doItIf(item is [.,p,x,y],$predl,$e) ==
oldFLP':=oldFLP
n:=0
while oldFLP' repeat
- oldFLP':=CDR oldFLP'
- flp1:=CDR flp1
+ oldFLP':=rest oldFLP'
+ flp1:=rest flp1
n:=n+1
-- Now we have to add code to compile all the elements
-- of functorLocalParameters that were added during the
@@ -1709,7 +1709,7 @@ compCategoryItem(x,predl,env) ==
noteExport(y,pred)
PUSH(MKQ [y,pred],$atList)
- --3. it may be a list, with PROGN as the CAR, and some information as the CDR
+ --3. it may be a list, with PROGN as the first, and some information as the CDR
x is ["PROGN",:l] =>
for u in l repeat
compCategoryItem(u,predl,env)
diff --git a/src/interp/dq.boot b/src/interp/dq.boot
index 43b1f009..e46e4897 100644
--- a/src/interp/dq.boot
+++ b/src/interp/dq.boot
@@ -57,8 +57,8 @@ dqAppend(x,y)==
else if null y
then x
else
- RPLACD (CDR x,CAR y)
- RPLACD (x, CDR y)
+ RPLACD (rest x,first y)
+ RPLACD (x, rest y)
x
dqConcat ld==
@@ -68,7 +68,7 @@ dqConcat ld==
then first ld
else dqAppend(first ld,dqConcat rest ld)
-dqToList s==if null s then nil else CAR s
+dqToList s==if null s then nil else first s
dqAddAppend(x,y)==
if null x
@@ -76,6 +76,6 @@ dqAddAppend(x,y)==
else if null y
then nil
else
- RPLACD (CDR x,CAR y)
- RPLACD (x, CDR y)
+ RPLACD (rest x,first y)
+ RPLACD (x, rest y)
x
diff --git a/src/interp/format.boot b/src/interp/format.boot
index 548629a5..e19ac004 100644
--- a/src/interp/format.boot
+++ b/src/interp/format.boot
@@ -419,8 +419,8 @@ form2String1 u ==
null argl => [ '":" ]
null rest argl => [ '":", form2String1 first argl ]
formDecl2String(argl.0,argl.1)
- op = "#" and CONSP argl and LISTP CAR argl =>
- STRINGIMAGE SIZE CAR argl
+ op = "#" and CONSP argl and LISTP first argl =>
+ STRINGIMAGE SIZE first argl
op = 'Join => formJoin2String argl
op = "ATTRIBUTE" => form2String1 first argl
op='Zero => 0
@@ -554,13 +554,13 @@ tuple2String argl ==
where
f x ==
ATOM x => object2String x
- -- [f CAR x,:f CDR x]
+ -- [f first x,:f rest x]
[f y for y in x]
script2String s ==
null s => '"" -- just to be safe
if atom s then s := [s]
- linearFormatForm(CAR s, CDR s)
+ linearFormatForm(first s, rest s)
linearFormatName x ==
atom x => x
@@ -754,7 +754,7 @@ pkey keyStuff ==
keyStuff := IFCDR keyStuff
next := IFCAR keyStuff
while CONSP next repeat
- if CAR next = 'dbN then dbN := second next
+ if first next = 'dbN then dbN := second next
else argL := next
keyStuff := IFCDR keyStuff
next := IFCAR keyStuff
diff --git a/src/interp/fortcall.boot b/src/interp/fortcall.boot
index edd5972b..efae972d 100644
--- a/src/interp/fortcall.boot
+++ b/src/interp/fortcall.boot
@@ -331,7 +331,7 @@ makeSpadFun(name,userArgs,args,dummies,decls,results,returnType,asps,aspInfo,
[["$elt","Result","construct"],body]]
stripNil u ==
- [CAR(u), ["construct",:second(u)], if third(u) then "true" else "false"]
+ [first(u), ["construct",:second(u)], if third(u) then "true" else "false"]
makeUnion aspType ==
-- The argument is the type of the asp to be generated. We would like to
@@ -595,11 +595,11 @@ prepareResults(results,args,dummies,values,decls) ==
-- -- Take a vector of vectors and return a single vector which is in column
-- -- order (i.e. swap from C to Fortran order).
-- els := nil
--- rows := CAR ARRAY_-DIMENSIONS(u)-1
--- cols := CAR ARRAY_-DIMENSIONS(ELT(u,0))-1
+-- rows := first ARRAY_-DIMENSIONS(u)-1
+-- cols := first ARRAY_-DIMENSIONS(ELT(u,0))-1
-- -- Could be a 3D Matrix
-- if VECTORP ELT(ELT(u,0),0) then
--- planes := CAR ARRAY_-DIMENSIONS(ELT(ELT(u,0),0))-1
+-- planes := first ARRAY_-DIMENSIONS(ELT(ELT(u,0),0))-1
-- for k in 0..planes repeat for j in 0..cols repeat for i in 0..rows repeat
-- els := [ELT(ELT(ELT(u,i),j),k),:els]
-- else
@@ -626,13 +626,13 @@ writeData(tmpFile,indata) ==
xdrWrite(xstr,v)
-- some array
VECTORP v =>
- rows := CAR ARRAY_-DIMENSIONS(v)
+ rows := first ARRAY_-DIMENSIONS(v)
-- is it 2d or more (most likely) ?
VECTORP ELT(v,0) =>
- cols := CAR ARRAY_-DIMENSIONS(ELT(v,0))
+ cols := first ARRAY_-DIMENSIONS(ELT(v,0))
-- is it 3d ?
VECTORP ELT(ELT(v,0),0) =>
- planes := CAR ARRAY_-DIMENSIONS(ELT(ELT(v,0),0))
+ planes := first ARRAY_-DIMENSIONS(ELT(ELT(v,0),0))
-- write 3d array
xdrWrite(xstr,rows*cols*planes)
for k in 0..planes-1 repeat
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index 6430f17f..d539cef6 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -135,7 +135,7 @@ PacPrint v ==
$Sublis:= [first Sublis,:$Sublis]
$WhereList:= [[name,:vv.j],:$WhereList]
vv.j:= name
- if CONSP vv.j and REFVECP(u:=CDR vv.j) then
+ if CONSP vv.j and REFVECP(u:=rest vv.j) then
l:= ASSQ(keyItem u,Sublis)
if l
then name:= rest l
@@ -211,7 +211,7 @@ compCategories u ==
pp rest v
-- the next line "fixes" a bad modemap which sometimes appears ....
--
- if rest v and NULL CAAAR v then v:=CDR v
+ if rest v and NULL CAAAR v then v:=rest v
v:= CDDAAR v
v:=resolvePatternVars(v, rest u) -- replaces #n forms
-- select the modemap part of the first entry, and skip result etc.
@@ -295,7 +295,7 @@ worthlessCode x ==
false
cons5(p,l) ==
- l and (CAAR l = CAR p) => [p,: rest l]
+ l and (CAAR l = first p) => [p,: rest l]
LENGTH l < 5 => [p,:l]
RPLACD(QCDDDDR l,nil)
[p,:l]
@@ -340,15 +340,15 @@ setVector12 args ==
--DomainSubstitutionFunction, would be (gensym) cons
--(category parameter), e.g. DirectProduct(length vl,NNI)
--as in DistributedMultivariatePolynomial
- args1:=[CAR u,:args1]
- args2:=[CDR u,:args2]
+ args1:=[first u,:args1]
+ args2:=[rest u,:args2]
freeof($domainShell.1,args1) and
freeof($domainShell.2,args1) and
freeof($domainShell.4,args1) => nil
[['SetDomainSlots124,'$,['QUOTE,args1],['LIST,:args2]]]
where freeof(a,b) ==
ATOM a => NULL MEMQ(a,b)
- freeof(CAR a,b) => freeof(CDR a,b)
+ freeof(first a,b) => freeof(rest a,b)
false
SetDomainSlots124(vec,names,vals) ==
@@ -611,7 +611,7 @@ DescendCode(code,flag,viewAssoc,EnvToPass) ==
while (c and (LAST c is [c1] or LAST c is [c1,[]]) and
(c1 = '(QUOTE T) or c1 is ['HasAttribute,:.])) repeat
--strip out some worthless junk at the end
- c:=NREVERSE CDR NREVERSE c
+ c:=NREVERSE rest NREVERSE c
null c => '(LIST)
['COND,:c]
code is ["%LET",name,body,:.] =>
@@ -787,7 +787,7 @@ InvestigateConditions catvecListMaker ==
--Rather like eval, but quotes parameters first
for u in second principal'.4 repeat
if not TruthP(cond:=second u) then
- new:=['CATEGORY,'domain,['IF,cond,['ATTRIBUTE,CAR u], '%noBranch]]
+ new:=['CATEGORY,'domain,['IF,cond,['ATTRIBUTE,first u], '%noBranch]]
$principal is ['Join,:l] =>
not member(new,l) =>
$principal:=['Join,:l,new]
@@ -803,15 +803,15 @@ InvestigateConditions catvecListMaker ==
[pessimise first a,:pessimise rest a]
null $Conditions => [true,:[true for u in secondaries]]
PrincipalSecondaries:= getViewsConditions principal'
- MinimalPrimary:= CAR first PrincipalSecondaries
+ MinimalPrimary:= first first PrincipalSecondaries
MaximalPrimary:= CAAR $domainShell.4
necessarySecondaries:= [first u for u in PrincipalSecondaries | rest u=true]
and/[member(u,necessarySecondaries) for u in secondaries] =>
[true,:[true for u in secondaries]]
$HackSlot4:=
MinimalPrimary=MaximalPrimary => nil
- MaximalPrimaries:=[MaximalPrimary,:CAR (CatEval MaximalPrimary).4]
- MinimalPrimaries:=[MinimalPrimary,:CAR (CatEval MinimalPrimary).4]
+ MaximalPrimaries:=[MaximalPrimary,:first (CatEval MaximalPrimary).4]
+ MinimalPrimaries:=[MinimalPrimary,:first (CatEval MinimalPrimary).4]
MaximalPrimaries:=S_-(MaximalPrimaries,MinimalPrimaries)
[[x] for x in MaximalPrimaries]
($Conditions:= Conds($principal,nil)) where
@@ -843,7 +843,7 @@ InvestigateConditions catvecListMaker ==
LENGTH u=1 => first u
['AND,:u]
for [v,:.] in newS repeat
- for v' in [v,:CAR (CatEval v).4] repeat
+ for v' in [v,:first (CatEval v).4] repeat
if (w:=assoc(v',$HackSlot4)) then
RPLAC(rest w,if rest w then mkOr(u,rest w) else u)
(list:= update(list,u,secondaries,newS)) where
@@ -938,7 +938,7 @@ getPossibleViews u ==
null vec.0 => [CAAR vec.4,:views] --*
[vec.0,:views] --*
--the two lines marked ensure that the principal view comes first
- --if you don't want it, CDR it off
+ --if you don't want it, rest it off
getViewsConditions u ==
@@ -948,14 +948,14 @@ getViewsConditions u ==
systemErrorHere ["getViewsConditions",u]
views:= [[first u,:second u] for u in second vec.4]
null vec.0 =>
- null CAR vec.4 => views
+ null first vec.4 => views
[[CAAR vec.4,:true],:views] --*
[[vec.0,:true],:views] --*
--the two lines marked ensure that the principal view comes first
- --if you don't want it, CDR it off
+ --if you don't want it, rest it off
DescendCodeVarAdd(base,flag) ==
- princview := CAR $catvecList
+ princview := first $catvecList
[SetFunctionSlots(sig,substitute('ELT,'CONST,implem),flag,'adding) repeat
for i in 6..MAXINDEX princview |
princview.i is [sig:=[op,types],:.] and
@@ -970,7 +970,7 @@ resolvePatternVars(p,args) ==
-- atom p =>
-- isSharpVarWithNum p => args.(position(p,$FormalMapVariableList))
-- p
--- [resolvePatternVars(CAR p,args),:resolvePatternVars(CDR p,args)]
+-- [resolvePatternVars(first p,args),:resolvePatternVars(rest p,args)]
-- Mysterious JENKS definition follows:
--DescendCodeVarAdd(base,flag) ==
diff --git a/src/interp/g-boot.boot b/src/interp/g-boot.boot
index b61dbed1..9ec302a7 100644
--- a/src/interp/g-boot.boot
+++ b/src/interp/g-boot.boot
@@ -69,7 +69,7 @@ mergeableCOND x ==
while (cls and ok) repeat
[[p,:r],:cls] := cls
CONSP QCDR r => ok := NIL
- CAR(r) isnt ['EXIT,.] => ok := NIL
+ first(r) isnt ['EXIT,.] => ok := NIL
NULL(cls) and ATOM(p) => ok := NIL
NULL(cls) and (p = ''T) => ok := NIL
ok
@@ -85,19 +85,19 @@ mergeCONDsWithEXITs l ==
a := QCAR l
if a is ['COND,:.] then a := flattenCOND a
am := mergeableCOND a
- CDR(l) is [b,:k] and am and mergeableCOND(b) =>
+ rest(l) is [b,:k] and am and mergeableCOND(b) =>
b:= flattenCOND b
c := ['COND,:QCDR a,:QCDR b]
mergeCONDsWithEXITs [flattenCOND c,:k]
- CDR(l) is [b] and am =>
+ rest(l) is [b] and am =>
[removeEXITFromCOND flattenCOND ['COND,:QCDR a,[''T,b]]]
- [a,:mergeCONDsWithEXITs CDR l]
+ [a,:mergeCONDsWithEXITs rest l]
removeEXITFromCOND? c ==
-- c is '(COND ...)
-- only can do it if every clause simply EXITs
ok := true
- c := CDR c
+ c := rest c
while ok and c repeat
[[p,:r],:c] := c
nakedEXIT? p => ok := NIL
@@ -110,7 +110,7 @@ removeEXITFromCOND? c ==
removeEXITFromCOND c ==
-- c is '(COND ...)
z := NIL
- for cl in CDR c repeat
+ for cl in rest c repeat
ATOM cl => z := CONS(cl,z)
cond := QCAR cl
length1? cl =>
@@ -120,7 +120,7 @@ removeEXITFromCOND c ==
lastSE := QCAR cl'
ATOM lastSE => z := CONS(cl,z)
lastSE is ["EXIT",:.] =>
- z := CONS(REVERSE CONS(second lastSE,CDR cl'),z)
+ z := CONS(REVERSE CONS(second lastSE,rest cl'),z)
z := CONS(cl,z)
CONS('COND,NREVERSE z)
@@ -148,7 +148,7 @@ bootIF c ==
bootCOND c ==
-- handles COND expressions: c is ['COND,:.]
- cls := CDR c
+ cls := rest c
NULL cls => NIL
cls is [[''T,r],:.] => r
[:icls,fcls] := cls
@@ -208,7 +208,7 @@ bootAbsorbSEQsAndPROGNs e ==
ATOM x => NIL
x is ['PROGN,:pcls,lpcl] =>
ATOM lpcl => pcls
- CDR x
+ rest x
-- next usually comes about from if foo then bar := zap
x is ['COND,y,[''T,'NIL]] => [['COND,y]]
[x]
@@ -221,7 +221,7 @@ bootAbsorbSEQsAndPROGNs e ==
APPEND(g,[lcl])
bootSEQ e ==
- e := ['SEQ,:mergeCONDsWithEXITs bootAbsorbSEQsAndPROGNs CDR e]
+ e := ['SEQ,:mergeCONDsWithEXITs bootAbsorbSEQsAndPROGNs rest e]
if e is [.,:cls,lcl] and IDENTP lcl and not MEMQ(lcl,$labelsForGO) then
e := ['SEQ,:cls,['EXIT,lcl]]
cls := QCDR e
@@ -238,7 +238,7 @@ bootSEQ e ==
tryToRemoveSEQ e
bootPROGN e ==
- e := ['PROGN,:bootAbsorbSEQsAndPROGNs CDR e]
+ e := ['PROGN,:bootAbsorbSEQsAndPROGNs rest e]
[.,:cls] := e
NULL cls => NIL
cls is [body] => body
@@ -258,21 +258,21 @@ defLET1(lhs,rhs) ==
rhs' := defLET2(lhs,rhs)
EQCAR(rhs',$LET) => MKPROGN [rhs',rhs]
rhs' is ["PROGN",:.] => APPEND(rhs',[rhs])
- if IDENTP CAR rhs' then rhs' := CONS(rhs',NIL)
+ if IDENTP first rhs' then rhs' := CONS(rhs',NIL)
MKPROGN [:rhs',rhs]
rhs is [=$LET,:.] and IDENTP(name := second rhs) =>
-- handle things like [a] := x := foo
l1 := defLET1(name,third rhs)
l2 := defLET1(lhs,name)
- l2 is ["PROGN",:.] => MKPROGN [l1,:CDR l2]
- if IDENTP CAR l2 then l2 := cons(l2,nil)
+ l2 is ["PROGN",:.] => MKPROGN [l1,:rest l2]
+ if IDENTP first l2 then l2 := cons(l2,nil)
MKPROGN [l1,:l2,name]
g := INTERN STRCONC('"LETTMP#",STRINGIMAGE $letGenVarCounter)
$letGenVarCounter := $letGenVarCounter + 1
rhs' := [$LET,g,rhs]
let' := defLET1(lhs,g)
- let' is ["PROGN",:.] => MKPROGN [rhs',:CDR let']
- if IDENTP CAR let' then let' := CONS(let',NIL)
+ let' is ["PROGN",:.] => MKPROGN [rhs',:rest let']
+ if IDENTP first let' then let' := CONS(let',NIL)
MKPROGN [rhs',:let',g]
defLET2(lhs,rhs) ==
@@ -290,11 +290,11 @@ defLET2(lhs,rhs) ==
defLET2(var2,addCARorCDR('CDR,rhs))
l1 := defLET2(var1,addCARorCDR('CAR,rhs))
var2 in '(NIL _.) => l1
- if CONSP l1 and ATOM CAR l1 then l1 := cons(l1,nil)
+ if CONSP l1 and ATOM first l1 then l1 := cons(l1,nil)
IDENTP var2 =>
[:l1,defLetForm(var2,addCARorCDR('CDR,rhs))]
l2 := defLET2(var2,addCARorCDR('CDR,rhs))
- if CONSP l2 and ATOM CAR l2 then l2 := cons(l2,nil)
+ if CONSP l2 and ATOM first l2 then l2 := cons(l2,nil)
APPEND(l1,l2)
lhs is ['APPEND,var1,var2] =>
patrev := defISReverse(var2,var1)
@@ -302,10 +302,10 @@ defLET2(lhs,rhs) ==
g := INTERN STRCONC('"LETTMP#",STRINGIMAGE $letGenVarCounter)
$letGenVarCounter := $letGenVarCounter + 1
l2 := defLET2(patrev,g)
- if CONSP l2 and ATOM CAR l2 then l2 := cons(l2,nil)
+ if CONSP l2 and ATOM first l2 then l2 := cons(l2,nil)
var1 = "." => [[$LET,g,rev],:l2]
last l2 is [=$LET, =var1, val1] =>
- [[$LET,g,rev],:REVERSE CDR REVERSE l2,
+ [[$LET,g,rev],:REVERSE rest REVERSE l2,
defLetForm(var1,['NREVERSE,val1])]
[[$LET,g,rev],:l2,defLetForm(var1,['NREVERSE,var1])]
lhs is ['EQUAL,var1] =>
@@ -396,7 +396,7 @@ defIS1(lhs,rhs) ==
$isGenVarCounter := $isGenVarCounter + 1
rev := ['AND,['CONSP,lhs],['PROGN,[$LET,g,['REVERSE,lhs]],''T]]
l2 := defIS1(g,patrev)
- if CONSP l2 and ATOM CAR l2 then l2 := cons(l2,nil)
+ if CONSP l2 and ATOM first l2 then l2 := cons(l2,nil)
a = "." => ['AND,rev,:l2]
['AND,rev,:l2,['PROGN,defLetForm(a,['NREVERSE,a]),''T]]
SAY '"WARNING (defIS1): possibly bad IS code being generated"
@@ -411,9 +411,9 @@ defIS(lhs,rhs) ==
bootOR e ==
-- flatten any contained ORs.
- cls := CDR e
+ cls := rest e
NULL cls => NIL
- NULL CDR cls => CAR cls
+ NULL rest cls => first cls
ncls := [:flatten(c) for c in cls] where
flatten x ==
x is ['OR,:.] => QCDR x
@@ -422,9 +422,9 @@ bootOR e ==
bootAND e ==
-- flatten any contained ANDs.
- cls := CDR e
+ cls := rest e
NULL cls => 'T
- NULL CDR cls => CAR cls
+ NULL rest cls => first cls
ncls := [:flatten(c) for c in cls] where
flatten x ==
x is ['AND,:.] => QCDR x
@@ -437,7 +437,7 @@ bootLabelsForGO e ==
ATOM e => NIL
[head,:tail] := e
IDENTP head =>
- head = 'GO => $labelsForGO := CONS(CAR tail,$labelsForGO)
+ head = 'GO => $labelsForGO := CONS(first tail,$labelsForGO)
head = 'QUOTE => NIL
bootLabelsForGO tail
bootLabelsForGO head
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index bbb6a81e..0e951254 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -260,7 +260,7 @@ optCond (x is ['COND,:l]) ==
AssocBarGensym(key,l) ==
for x in l repeat
CONSP x =>
- EqualBarGensym(key,CAR x) => return x
+ EqualBarGensym(key,first x) => return x
EqualBarGensym(x,y) ==
$GensymAssoc: fluid := nil
@@ -569,6 +569,6 @@ for x in '( (call optCall) _
(RECORDELT optRECORDELT)_
(SETRECORDELT optSETRECORDELT)_
(RECORDCOPY optRECORDCOPY)) _
- repeat MAKEPROP(CAR x,'OPTIMIZE, second x)
+ repeat MAKEPROP(first x,'OPTIMIZE, second x)
--much quicker to call functions if they have an SBC
diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot
index 10b0521a..1e737c68 100644
--- a/src/interp/g-timer.boot
+++ b/src/interp/g-timer.boot
@@ -63,7 +63,7 @@ makeLongStatStringByProperty _
otherStatTotal := GETL('other, property)
for [name,class,:ab] in listofnames repeat
name = 'other => 'iterate
- cl := CAR LASSOC(class,listofclasses)
+ cl := first LASSOC(class,listofclasses)
n := GETL( name, property)
PUT(cl,classproperty, n + GETL(cl,classproperty))
total := total + n
@@ -78,8 +78,8 @@ makeLongStatStringByProperty _
if otherStatTotal > 0 then
str := makeStatString(str,normalizeStatAndStringify otherStatTotal,'O,flag)
total := total + otherStatTotal
- cl := CAR LASSOC('other,listofnames)
- cl := CAR LASSOC(cl,listofclasses)
+ cl := first LASSOC('other,listofnames)
+ cl := first LASSOC(cl,listofclasses)
PUT(cl,classproperty, otherStatTotal + GETL(cl,classproperty))
if flag ~= 'long then
total := 0
@@ -132,7 +132,7 @@ popTimedName() ==
pushTimedName name ==
PUSH(name,$timedNameStack)
---currentlyTimedName() == CAR $timedNameStack
+--currentlyTimedName() == first $timedNameStack
startTimingProcess name ==
updateTimedName peekTimedName()
@@ -219,7 +219,7 @@ makeLongSpaceString(listofnames,listofclasses) ==
'"bytes", $printStorageIfTrue)
computeElapsedTime() ==
- -- in total time lists, CAR is VIRTCPU and second is TOTCPU
+ -- in total time lists, first is VIRTCPU and second is TOTCPU
currentTime:= elapsedUserTime()
currentGCTime:= elapsedGcTime()
gcDelta := currentGCTime - $oldElapsedGCTime
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index c6241500..6e81bee5 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -178,8 +178,8 @@ get(x,prop,e) ==
get0(x,prop,e) ==
not atom x => get(QCAR x,prop,e)
- u:= QLASSQ(x,CAR QCAR e) => QLASSQ(prop,u)
- (tail:= CDR QCAR e) and (u:= fastSearchCurrentEnv(x,tail)) =>
+ u:= QLASSQ(x,first QCAR e) => QLASSQ(prop,u)
+ (tail:= rest QCAR e) and (u:= fastSearchCurrentEnv(x,tail)) =>
QLASSQ(prop,u)
nil
@@ -339,12 +339,12 @@ length2? l == CONSP l and CONSP (l := QCDR l) and not CONSP QCDR l
pairList(u,v) == [[x,:y] for x in u for y in v]
-- GETALIST(alist,prop) == IFCDR assoc(prop,alist)
-GETALIST(alist,prop) == CDR assoc(prop,alist)
+GETALIST(alist,prop) == rest assoc(prop,alist)
PUTALIST(alist,prop,val) ==
null alist => [[prop,:val]]
pair := assoc(prop,alist) =>
- CDR pair = val => alist
+ rest pair = val => alist
-- else we fall over Lucid's read-only storage feature again
QRPLACD(pair,val)
alist
@@ -355,8 +355,8 @@ REMALIST(alist,prop) ==
null alist => alist
alist is [[ =prop,:.],:r] =>
null r => NIL
- QRPLACA(alist,CAR r)
- QRPLACD(alist,CDR r)
+ QRPLACA(alist,first r)
+ QRPLACD(alist,rest r)
alist
null rest alist => alist
l := alist
@@ -550,7 +550,7 @@ listSort(pred,list,:optional) ==
NOT functionp pred => error "listSort: first arg must be a function"
NOT LISTP list => error "listSort: second argument must be a list"
NULL optional => mergeSort(pred,function Identity,list,LENGTH list)
- key := CAR optional
+ key := first optional
NOT functionp key => error "listSort: last arg must be a function"
mergeSort(pred,key,list,LENGTH list)
@@ -804,8 +804,8 @@ intern x ==
x
isDomain a ==
- CONSP a and VECP(CAR a) and
- member(CAR(a).0, $domainTypeTokens)
+ CONSP a and VECP(first a) and
+ member(first(a).0, $domainTypeTokens)
-- variables used by browser
diff --git a/src/interp/guess.boot b/src/interp/guess.boot
index 531df6b5..87d2002e 100644
--- a/src/interp/guess.boot
+++ b/src/interp/guess.boot
@@ -50,7 +50,7 @@ buildWordTable u ==
for key in HKEYS table repeat
HPUT(table,key,
listSort(function GLESSEQP,removeDupOrderedAlist
- listSort(function GLESSEQP, HGET(table,key),function CAR),
+ listSort(function GLESSEQP, HGET(table,key),function first),
function second))
table
@@ -113,15 +113,15 @@ findWords(word,table) ==
$countThreshold := $countThreshold + 2
res := findApproximateWords(word,table)
$lastAlist := mySort res =>
--- $lastMinimum := CAR LAST $lastAlist
+-- $lastMinimum := first LAST $lastAlist
-- $lastWords := wordSort CDAR $lastAlist
-- $totalWords:= $lastWords
--- $lastAlist := CDR $lastAlist
+-- $lastAlist := rest $lastAlist
-- $totalWords
$lastMinimum := CAAR $lastAlist
$lastWords := wordSort CDAR $lastAlist
$totalWords:= $lastWords
- $lastAlist := CDR $lastAlist
+ $lastAlist := rest $lastAlist
$totalWords
$lastWords := nil
@@ -131,7 +131,7 @@ more() == moreWords($lastWord,$lastTable)
moreWords(word,table) ==
$lastAlist =>
- $lastMinimum := CAR LAST pp $lastAlist
+ $lastMinimum := first LAST pp $lastAlist
numberOfLastWords := #$lastWords
$lastWords := "append"/(ASSOCRIGHT $lastAlist)
if #$lastWords > numberOfLastWords then
@@ -182,7 +182,7 @@ findApproximateWords(word,table) ==
consAlist(x,y,alist) ==
u := ASSOC(x,alist) =>
- RPLACD(u,[y,:CDR u])
+ RPLACD(u,[y,:rest u])
alist
[[x,y],:alist]
@@ -266,7 +266,7 @@ findApproxSimple(words,wordList,threshold) ==
rotateWordList u ==
v := u
- p := CAR v
+ p := first v
while QCDR v repeat
RPLACA(v,second v)
v := QCDR v
diff --git a/src/interp/hashcode.boot b/src/interp/hashcode.boot
index 0dd8100e..16c42a95 100644
--- a/src/interp/hashcode.boot
+++ b/src/interp/hashcode.boot
@@ -42,7 +42,7 @@ $DomainsWithoutLisplibs ==
-- Type hasher for old compiler style type names which produces a hash code
-- compatible with the asharp compiler. Takes a hard error if the type
-- is parameterized, but has no constructor modemap.
-getDomainHash dom == SPADCALL(CDR dom, (CAR dom).4)
+getDomainHash dom == SPADCALL(rest dom, (first dom).4)
hashType(type, percentHash) ==
SYMBOLP type =>
diff --git a/src/interp/ht-util.boot b/src/interp/ht-util.boot
index c840f667..22667c3c 100644
--- a/src/interp/ht-util.boot
+++ b/src/interp/ht-util.boot
@@ -220,8 +220,8 @@ bcIssueHt line ==
mapStringize l ==
ATOM l => l
- RPLACA(l, basicStringize CAR l)
- RPLACD(l, mapStringize CDR l)
+ RPLACA(l, basicStringize first l)
+ RPLACD(l, mapStringize rest l)
l
basicStringize s ==
@@ -534,14 +534,14 @@ parseAndEval1 string ==
syntaxError := false
pform :=
v := applyWithOutputToString('ncParseFromString, [string])
- CAR v => CAR v
+ first v => first v
syntaxError := true
- CDR v
+ rest v
syntaxError =>
'"Syntax Error "
pform =>
val := applyWithOutputToString('processInteractive, [pform, nil])
- CAR val => CAR val
+ first val => first val
'"Type Analysis Error"
nil
@@ -582,8 +582,8 @@ unescapeStringsInForm form ==
str := NSUBSTITUTE(char '_", $funnyQuote, form)
NSUBSTITUTE(char '_\, $funnyBacks, str)
CONSP form =>
- unescapeStringsInForm CAR form
- unescapeStringsInForm CDR form
+ unescapeStringsInForm first form
+ unescapeStringsInForm rest form
form
form
diff --git a/src/interp/i-analy.boot b/src/interp/i-analy.boot
index 01c42858..96b11193 100644
--- a/src/interp/i-analy.boot
+++ b/src/interp/i-analy.boot
@@ -138,10 +138,10 @@ pushDownTargetInfo(op,target,arglist) ==
2 = nargs =>
op = "*" => -- only push down on 1st arg if not immed
if not getTarget second arglist then putTarget(second arglist,target)
- getTarget(x := CAR arglist) => NIL
+ getTarget(x := first arglist) => NIL
if getUnname(x) ~= $immediateDataSymbol then putTarget(x,target)
op = "**" or op = "^" => -- push down on base
- if not getTarget CAR arglist then putTarget(CAR arglist,target)
+ if not getTarget first arglist then putTarget(first arglist,target)
(op = 'equation) and (target is ['Equation,S]) =>
for x in arglist repeat
if not getTarget(x) then putTarget(x,S)
@@ -166,7 +166,7 @@ pushDownTargetInfo(op,target,arglist) ==
pushDownOnArithmeticVariables(op,target,arglist) ==
-- tries to push appropriate target information onto variable
-- occurring in arithmetic expressions
- CONSP(target) and CAR(target) = 'Variable => NIL
+ CONSP(target) and first(target) = 'Variable => NIL
not MEMQ(op,'(_+ _- _* _*_* _/)) => NIL
not containsPolynomial(target) => NIL
for x in arglist for i in 1.. repeat
@@ -270,7 +270,7 @@ bottomUp t ==
-- given no target or package calling, force integer constants to
-- belong to tightest possible subdomain
- op := CAR t -- may have changed in bottomUpElt
+ op := first t -- may have changed in bottomUpElt
$useIntegerSubdomain and null tar and null dol and
isEqualOrSubDomain(first ms,$Integer) =>
val := objVal getValue op
@@ -302,7 +302,7 @@ bottomUpCompile t ==
bottomUpUseSubdomain t ==
$useIntegerSubdomain : local := true
ms := bottomUp t
- ($immediateDataSymbol ~= getUnname(t)) or ($Integer ~= CAR(ms)) => ms
+ ($immediateDataSymbol ~= getUnname(t)) or ($Integer ~= first(ms)) => ms
null INTEGERP(num := objValUnwrap getValue t) => ms
o := getBasicObject(num)
putValue(t,o)
@@ -596,7 +596,7 @@ bottomUpForm0(t,op,opName,argl,argModeSetList) ==
-- this is a hack until Records go through the normal
-- modemap selection process
rtype := ['Record,:rargs]
- code := optRECORDCOPY(['RECORDCOPY,getArgValue(CAR argl, rtype),#rargs])
+ code := optRECORDCOPY(['RECORDCOPY,getArgValue(first argl, rtype),#rargs])
if $genValue then code := wrap timedEVALFUN code
val := objNew(code,rtype)
@@ -754,7 +754,7 @@ bottomUpFormRetract(t,op,opName,argl,amsl) ==
(i = 1) and (opName = "set!") =>
a := [x,:a]
ms := [m,:ms]
- if CONSP(m) and CAR(m) = $EmptyMode then return NIL
+ if CONSP(m) and first(m) = $EmptyMode then return NIL
object:= retract getValue x
a:= [x,:a]
object="failed" =>
@@ -840,8 +840,8 @@ bottomUpElt (form:=[op,:argl]) ==
ms := bottomUp op
ms and (ms is [['Union,:.]] or ms is [['Record,:.]]) =>
- RPLAC(CDR form, [op,:argl])
- RPLAC(CAR form, mkAtreeNode "elt")
+ RPLAC(rest form, [op,:argl])
+ RPLAC(first form, mkAtreeNode "elt")
bottomUp form
target := getTarget form
@@ -852,16 +852,16 @@ bottomUpElt (form:=[op,:argl]) ==
while null u for newOp in newOps repeat
newArgs := [op,:argl]
if selectMms(newOp, newArgs, target) then
- RPLAC(CDR form, newArgs)
- RPLAC(CAR form, newOp)
+ RPLAC(rest form, newArgs)
+ RPLAC(first form, newOp)
u := bottomUp form
while null u and ( "and"/[retractAtree(a) for a in newArgs] ) repeat
while null u for newOp in newOps repeat
newArgs := [op,:argl]
if selectMms(newOp, newArgs, target) then
- RPLAC(CDR form, newArgs)
- RPLAC(CAR form, newOp)
+ RPLAC(rest form, newArgs)
+ RPLAC(first form, newOp)
u := bottomUp form
u
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index efa79337..3765b4ba 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -304,7 +304,7 @@ retractByFunction(object,u) ==
sayFunctionSelectionResult(funName,[t],mms)
null mms => NIL
- -- [[dc,:.],slot,.]:= CAR mms
+ -- [[dc,:.],slot,.]:= first mms
dc := CAAAR mms
slot := CADAR mms
dcVector:= evalDomain dc
@@ -312,7 +312,7 @@ retractByFunction(object,u) ==
--+
compiledLookup(funName,[target,t],dcVector)
NULL fun => NIL
- CAR(fun) = function Undef => NIL
+ first(fun) = function Undef => NIL
--+
$: fluid := dcVector
object' := coerceUnion2Branch objNewWrap(SPADCALL(val,fun),target)
@@ -429,8 +429,8 @@ canCoerce1(t1,t2) ==
absolutelyCannotCoerce(t1,t2) => NIL
- nt1 := CAR t1
- nt2 := CAR t2
+ nt1 := first t1
+ nt2 := first t2
nt1="Mapping" => nt2="Any"
nt2="Mapping" =>
@@ -561,7 +561,7 @@ canCoerceByMap(t1,t2) ==
1 = #u2 => NIL
u1 := deconstructT t1
1 = #u1 => NIL -- no under domain
- CAR(u1) ~= CAR(u2) => NIL
+ first(u1) ~= first(u2) => NIL
top := CAAR u1
u1 := underDomainOf t1
u2 := underDomainOf t2
@@ -604,8 +604,8 @@ canCoerceTower(t1,t2) ==
canCoerceLocal(t1,t2) ==
-- test for coercion on top level
- p:= ASSQ(CAR t1,$CoerceTable)
- p and ASSQ(CAR t2,CDR p) is [.,:[tag,fun]] =>
+ p:= ASSQ(first t1,$CoerceTable)
+ p and ASSQ(first t2,rest p) is [.,:[tag,fun]] =>
tag='partial => NIL
tag='total => true
(functionp(fun) and
@@ -617,10 +617,10 @@ canCoerceCommute(t1,t2) ==
-- THIS IS OUT-MODED AND WILL GO AWAY SOON RSS 2-87
-- t1 is t2 with the two top level constructors commuted
-- looks for the existence of a commuting function
- CAR(t1) in (l := [$QuotientField, 'Gaussian]) and
- CAR(t2) in l => true
- p:= ASSQ(CAR t1,$CommuteTable)
- p and ASSQ(CAR t2,CDR p) is [.,:['commute,.]]
+ first(t1) in (l := [$QuotientField, 'Gaussian]) and
+ first(t2) in l => true
+ p:= ASSQ(first t1,$CommuteTable)
+ p and ASSQ(first t2,rest p) is [.,:['commute,.]]
newCanCoerceCommute(t1,t2) ==
coerceIntCommute(objNewWrap("$fromCoerceable$",t1),t2)
@@ -630,15 +630,15 @@ canCoercePermute(t1,t2) ==
-- t1 into t2
member(t2,'((Integer) (OutputForm))) => NIL
towers := computeTTTranspositions(t1,t2)
- -- at this point, CAR towers = t1 and last towers should be similar
+ -- at this point, first towers = t1 and last towers should be similar
-- to t2 in the sense that the components of t1 are in the same order
-- as in t2. If length towers = 2 and t2 = last towers, we quit to
-- avoid an infinte loop.
- NULL towers or NULL CDR towers => NIL
+ NULL towers or NULL rest towers => NIL
NULL CDDR towers and t2 = second towers => NIL
-- do the coercions successively, quitting if any fail
ok := true
- for t in CDR towers while ok repeat
+ for t in rest towers while ok repeat
ok := canCoerce(t1,t)
if ok then t1 := t
ok
@@ -663,7 +663,7 @@ canCoerceByFunction1(m1,m2,fun) ==
l := selectMms1(fun,t2,[t1],[t1],NIL)
ans := [x for x in l | x is [sig,:.] and second sig=t2 and
third sig=t1 and
- CAR(sig) isnt ['TypeEquivalence,:.]] and true
+ first(sig) isnt ['TypeEquivalence,:.]] and true
ans
absolutelyCanCoerceByCheating(t1,t2) ==
@@ -686,8 +686,8 @@ absolutelyCannotCoerce(t1,t2) ==
-- this is largely an efficiency hack
ATOM(t1) or ATOM(t2) => NIL
t2 = $None => true
- n1 := CAR t1
- n2 := CAR t2
+ n1 := first t1
+ n2 := first t2
QFI := [$QuotientField, $Integer]
int2 := isEqualOrSubDomain(t2,$Integer)
scalars := '(BigFloat NewFloat Float DoubleFloat RationalNumber)
@@ -727,7 +727,7 @@ absolutelyCannotCoerce(t1,t2) ==
1 = #v2 => NIL
v1 := deconstructT t1
1 = #v1 => NIL
- CAR(v1) ~= CAR(v2) => NIL
+ first(v1) ~= first(v2) => NIL
absolutelyCannotCoerce(u1,u2)
typeIsASmallInteger x == (x = $SingleInteger)
@@ -872,7 +872,7 @@ coerceInt1(triple,t2) ==
$genValue =>
fun := getFunctionFromDomain(unwrap val,dc,argl)
objNewWrap(fun,t2)
- val := NRTcompileEvalForm(unwrap val, CDR CAAR mms, evalDomain dc)
+ val := NRTcompileEvalForm(unwrap val, rest CAAR mms, evalDomain dc)
objNew(val, t2)
(t1 is ['Variable,sym]) and (t2 is ['Mapping,target,:margl]) =>
null (mms := selectMms1(sym,target,margl,margl,NIL)) =>
@@ -881,7 +881,7 @@ coerceInt1(triple,t2) ==
targ ~= target => NIL
dc is ["__FreeFunction__",:freeFun] => objNew( freeFun, t2 )
$genValue => objNewWrap( getFunctionFromDomain(sym,dc,argl), t2 )
- val := NRTcompileEvalForm(sym, CDR CAAR mms, evalDomain dc)
+ val := NRTcompileEvalForm(sym, rest CAAR mms, evalDomain dc)
objNew(val, t2)
(t1 is ['FunctionCalled,sym]) and (t2 is ['Mapping,target,:margl]) =>
symNode := mkAtreeNode sym
@@ -902,9 +902,9 @@ coerceInt1(triple,t2) ==
NIL
NIL
- EQ(CAR(t1),'Variable) and CONSP(t2) and
+ EQ(first(t1),'Variable) and CONSP(t2) and
(isEqualOrSubDomain(t2,$Integer) or
- (t2 = [$QuotientField, $Integer]) or MEMQ(CAR(t2),
+ (t2 = [$QuotientField, $Integer]) or MEMQ(first(t2),
'(RationalNumber BigFloat NewFloat Float DoubleFloat))) => NIL
ans := coerceRetract(triple,t2) or coerceIntTower(triple,t2) or
@@ -979,12 +979,12 @@ coerceUnion2Branch(object) ==
predicate := pred
targetType := typ
null targetType => keyedSystemError("S2IC0013",NIL)
- predicate is ['EQCAR,.,p] => objNewWrap(CDR val',targetType)
+ predicate is ['EQCAR,.,p] => objNewWrap(rest val',targetType)
objNew(objVal object,targetType)
coerceBranch2Union(object,union) ==
-- assumes type is a member of doms
- doms := CDR union
+ doms := rest union
predList:= mkPredList doms
doms := stripUnionTags doms
p := position(objMode object,doms)
@@ -997,7 +997,7 @@ coerceBranch2Union(object,union) ==
coerceInt2Union(object,union) ==
-- coerces to a Union type, adding numeric tags
-- first cut
- unionDoms := stripUnionTags CDR union
+ unionDoms := stripUnionTags rest union
t1 := objMode object
member(t1,unionDoms) => coerceBranch2Union(object,union)
val := objVal object
@@ -1028,7 +1028,7 @@ coerceIntByMap(triple,t2) ==
1 = #u1 => NIL
CAAR u1 ~= CAAR u2 => nil -- constructors not equal
not valueArgsEqual?(t1, t2) => NIL
--- CAR u1 ~= CAR u2 => NIL
+-- first u1 ~= first u2 => NIL
top := CAAR u1
u1 := underDomainOf t1
u2 := underDomainOf t2
@@ -1046,7 +1046,7 @@ coerceIntByMap(triple,t2) ==
sayFunctionSelectionResult('map,args,mms)
null mms => NIL
- [[dc,:sig],slot,.]:= CAR mms
+ [[dc,:sig],slot,.]:= first mms
fun := compiledLookup('map,sig,evalDomain(dc))
NULL fun => NIL
[fn,:d]:= fun
@@ -1132,8 +1132,8 @@ coerceIntTableOrFunction(triple,t2) ==
null isValidType t2 => NIL -- added 9-18-85 by RSS
null isLegitimateMode(t2,NIL,NIL) => NIL -- added 6-28-87 by RSS
t1 := objMode triple
- p:= ASSQ(CAR t1,$CoerceTable)
- p and ASSQ(CAR t2,CDR p) is [.,:[tag,fun]] =>
+ p:= ASSQ(first t1,$CoerceTable)
+ p and ASSQ(first t2,rest p) is [.,:[tag,fun]] =>
val := objVal triple
fun='Identity => objNew(val,t2)
tag='total =>
@@ -1154,8 +1154,8 @@ coerceCommuteTest(t1,t2) ==
null (v2 := underDomainOf u2) => NIL
-- now check that cross of constructors is correct
- (CAR(deconstructT t1) = CAR(deconstructT u2)) and
- (CAR(deconstructT t2) = CAR(deconstructT u1))
+ (first(deconstructT t1) = first(deconstructT u2)) and
+ (first(deconstructT t2) = first(deconstructT u1))
coerceIntCommute(obj,target) ==
-- note that the value in obj may be $fromCoerceable$, for canCoerce
@@ -1182,15 +1182,15 @@ coerceIntPermute(object,t2) ==
member(t2,'((Integer) (OutputForm))) => NIL
t1 := objMode object
towers := computeTTTranspositions(t1,t2)
- -- at this point, CAR towers = t1 and last towers should be similar
+ -- at this point, first towers = t1 and last towers should be similar
-- to t2 in the sense that the components of t1 are in the same order
-- as in t2. If length towers = 2 and t2 = last towers, we quit to
-- avoid an infinte loop.
- NULL towers or NULL CDR towers => NIL
+ NULL towers or NULL rest towers => NIL
NULL CDDR towers and t2 = second towers => NIL
-- do the coercions successively, quitting if any fail
ok := true
- for t in CDR towers while ok repeat
+ for t in rest towers while ok repeat
null (object := coerceInt(object,t)) => ok := NIL
ok => object
NIL
@@ -1224,12 +1224,12 @@ computeTTTranspositions(t1,t2) ==
towers := [tl1]
tower := LIST2VEC tl1
for perm in perms repeat
- t := tower.(CAR perm)
- tower.(CAR perm) := tower.(CDR perm)
- tower.(CDR perm) := t
+ t := tower.(first perm)
+ tower.(first perm) := tower.(rest perm)
+ tower.(rest perm) := t
towers := CONS(VEC2LIST tower,towers)
towers := [reassembleTowerIntoType tower for tower in towers]
- if CAR(towers) ~= t2 then towers := cons(t2,towers)
+ if first(towers) ~= t2 then towers := cons(t2,towers)
NREVERSE towers
decomposeTypeIntoTower t ==
@@ -1241,7 +1241,7 @@ decomposeTypeIntoTower t ==
reassembleTowerIntoType tower ==
ATOM tower => tower
- NULL rest tower => CAR tower
+ NULL rest tower => first tower
[:top,t,s] := tower
reassembleTowerIntoType [:top,[:t,s]]
@@ -1274,8 +1274,8 @@ coerceIntTest(t1,t2) ==
-- thus the type can be bubbled before coerceIntTableOrFunction is called
t1=t2 or
b:=
- p:= ASSQ(CAR t1,$CoerceTable)
- p and ASSQ(CAR t2,CDR p)
+ p:= ASSQ(first t1,$CoerceTable)
+ p and ASSQ(first t2,rest p)
b or coerceConvertMmSelection('coerce,t1,t2) or
($useConvertForCoercions and
coerceConvertMmSelection('convert,t1,t2))
@@ -1318,7 +1318,7 @@ coerceByFunction(T,m2) ==
[fn,:d]:= fun
isWrapped x =>
x:= unwrap x
- objNewWrap(SPADCALL(CAR x,CDR x,fun),m2)
+ objNewWrap(SPADCALL(first x,rest x,fun),m2)
x isnt ['SPADCALL,a,b,:.] => keyedSystemError("S2IC0015",NIL)
code := ['SPADCALL, a, b, fun]
objNew(code,$Boolean)
diff --git a/src/interp/i-coerfn.boot b/src/interp/i-coerfn.boot
index ff642d94..80111088 100644
--- a/src/interp/i-coerfn.boot
+++ b/src/interp/i-coerfn.boot
@@ -303,7 +303,7 @@ Dmp2Up(u, source is [dmp,vl,S],target is [up,var,T]) ==
y:= coerceInt(objNewWrap([[e1,:c]],S1),T) =>
-- need to be careful about zeros
p:= ASSQ(exp,x) =>
- c' := SPADCALL(CDR p,objValUnwrap(y),plusfunc)
+ c' := SPADCALL(rest p,objValUnwrap(y),plusfunc)
c' = zero => x := REMALIST(x,exp)
RPLACD(p,c')
zero = objValUnwrap(y) => 'iterate
@@ -316,8 +316,8 @@ removeVectorElt(v,pos) ==
LIST2VEC [x for x in VEC2LIST v for y in 0.. | not (y=pos)]
removeListElt(l,pos) ==
- pos = 0 => CDR l
- [CAR l, :removeListElt(CDR l,pos-1)]
+ pos = 0 => rest l
+ [first l, :removeListElt(rest l,pos-1)]
NDmp2domain(u,source is [ndmp,x,S],target) ==
-- a null NDMP = 0
@@ -386,7 +386,7 @@ Expr2Dmp(u,source is [Expr,S], target is [dmp,v2,T]) ==
null rest v2 =>
for term in univ repeat
- RPLACA(term, VECTOR CAR term)
+ RPLACA(term, VECTOR first term)
univ
-- more than one variable
@@ -447,11 +447,11 @@ Expr2Up(u,source is [Expr,S], target is [.,var,T]) ==
sup := ['SparseUnivariatePolynomial, source]
fracUniv := SPADCALL(u, varKernel, univFunc)
- denom := CDR fracUniv
+ denom := rest fracUniv
not equalOne(denom, sup) => coercionFailure()
- numer := CAR fracUniv
+ numer := first fracUniv
uniType := ['UnivariatePolynomial, var, source]
(z := coerceInt(objNewWrap(numer, uniType), target)) => objValUnwrap z
coercionFailure()
@@ -1155,7 +1155,7 @@ Qf2F(u,source is [.,D,:.],target) ==
(unwrap num') * QUOTIENT(1.0, unwrap den')
Rn2F(rnum, source, target) ==
- float QUOTIENT(CAR rnum, CDR rnum)
+ float QUOTIENT(first rnum, rest rnum)
-- next function is needed in RN algebra code
--Rn2F([a,:b],source,target) ==
@@ -1247,9 +1247,9 @@ Rm2V(x,[.,.,.,R],target) == M2V(x,['Matrix,R],target)
Scr2Scr(u, source is [.,S], target is [.,T]) ==
u = '_$fromCoerceable_$ => canCoerce(S,T)
- null (v := coerceInt(objNewWrap(CDR u,S),T)) =>
+ null (v := coerceInt(objNewWrap(rest u,S),T)) =>
coercionFailure()
- [CAR u, :objValUnwrap(v)]
+ [first u, :objValUnwrap(v)]
--% SparseUnivariatePolynomialnimial
@@ -1711,8 +1711,8 @@ P2Us(u, source is [.,S], target is [.,T,var,cen], type) ==
package := ['ExpressionToUnivariatePowerSeries, S, E]
func := getFunctionFromDomain(type, package, [E, EQtype])
newObj := SPADCALL(objValUnwrap(newU), eq, func)
- newType := CAR newObj
- newVal := CDR newObj
+ newType := first newObj
+ newVal := rest newObj
newType = target => newVal
finalObj := coerceInt(objNewWrap(newVal, newType), target)
null finalObj => coercionFailure()
diff --git a/src/interp/i-eval.boot b/src/interp/i-eval.boot
index f89d76d2..943f56ad 100644
--- a/src/interp/i-eval.boot
+++ b/src/interp/i-eval.boot
@@ -235,7 +235,7 @@ evalForm(op,opName,argl,mmS) ==
-- applies the first applicable function
for mm in mmS until form repeat
[sig,fun,cond]:= mm
- (CAR sig) = 'interpOnly => form := CAR sig
+ (first sig) = 'interpOnly => form := first sig
#argl ~= #CDDR sig => 'skip ---> RDJ 6/95
form:=
$genValue or null cond =>
@@ -244,7 +244,7 @@ evalForm(op,opName,argl,mmS) ==
[getArgValueComp2(x,t,c,sideEffectedArg?(t,sig,opName),opName) or return NIL
for x in argl for t in CDDR sig for c in cond]
form or null argl =>
- dc:= CAR sig
+ dc:= first sig
form :=
dc='local => --[fun,:form]
atom fun =>
@@ -271,7 +271,7 @@ evalForm(op,opName,argl,mmS) ==
null fun0 => throwKeyedMsg("S2IE0008",[opName])
[bpi,:domain] := fun0
EQ(bpi,function Undef) =>
- sayKeyedMsg("S2IE0009",[opName,formatSignature CDR sig,CAR sig])
+ sayKeyedMsg("S2IE0009",[opName,formatSignature rest sig,first sig])
NIL
if $NRTmonitorIfTrue = true then
sayBrightlyNT ['"Applying ",first fun0,'" to:"]
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index 47cd20ee..578f8729 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -197,7 +197,7 @@ selectMms2(op,tar,args1,args2,$Coerce) ==
if tar and not isPartialMode tar then
if xx := underDomainOf(tar) then a := cons(xx,a)
for x in args1 repeat
- CONSP(x) and CAR(x) in '(List Vector Stream FiniteSet Array) =>
+ CONSP(x) and first(x) in '(List Vector Stream FiniteSet Array) =>
xx := underDomainOf(x) => a := cons(xx,a)
-- now extend this list with those from the arguments to
@@ -226,8 +226,8 @@ selectMms2(op,tar,args1,args2,$Coerce) ==
-- step 1. see if we have one without coercing
a' := a
while a repeat
- x:= CAR a
- a:= CDR a
+ x:= first a
+ a:= rest a
ATOM x => 'iterate
mmS := append(mmS, findFunctionInDomain(op,x,tar,args1,args2,NIL,NIL))
@@ -237,8 +237,8 @@ selectMms2(op,tar,args1,args2,$Coerce) ==
if null(mmS) and $Coerce then
a := a'
while a repeat
- x:= CAR a
- a:= CDR a
+ x:= first a
+ a:= rest a
ATOM x => 'iterate
mmS := append(mmS,
findFunctionInDomain(op,x,tar,args1,args2,$Coerce,NIL))
@@ -273,7 +273,7 @@ defaultTarget(opNode,op,nargs,args) ==
target
target
- a1 := CAR args
+ a1 := first args
ATOM a1 => target
a1f := QCAR a1
@@ -404,7 +404,7 @@ defaultTarget(opNode,op,nargs,args) ==
putTarget(opNode, target := $RationalNumber)
target
a1 = a2 =>
- if (target := resolveTCat(CAR args,'(Field))) then
+ if (target := resolveTCat(first args,'(Field))) then
putTarget(opNode,target)
target
a1 is ['Variable,.] and a2 is ['Variable,.] =>
@@ -487,13 +487,13 @@ getOpArgTypes1(opname, args) ==
null args => NIL
-- special cases first
opname = 'coef and args is [b,n] =>
- [CAR getModeSet b, CAR getModeSetUseSubdomain n]
+ [first getModeSet b, first getModeSetUseSubdomain n]
opname = 'monom and args is [d,c] =>
- [CAR getModeSetUseSubdomain d,CAR getModeSet c]
+ [first getModeSetUseSubdomain d,first getModeSet c]
opname = 'monom and args is [v,d,c] =>
- [CAR getModeSet v,CAR getModeSetUseSubdomain d,CAR getModeSet c]
+ [first getModeSet v,first getModeSetUseSubdomain d,first getModeSet c]
(opname = 'cons) and (2 = #args) and (second(args) = 'nil) =>
- ms := [CAR getModeSet x for x in args]
+ ms := [first getModeSet x for x in args]
if second(ms) = '(List (None)) then
ms := [first ms,['List,first ms]]
ms
@@ -502,8 +502,8 @@ getOpArgTypes1(opname, args) ==
mss := NIL
for i in 0..(nargs-1) for x in args repeat
ms :=
- v.i = 0 => CAR getModeSet x
- CAR getModeSetUseSubdomain x
+ v.i = 0 => first getModeSet x
+ first getModeSetUseSubdomain x
mss := [ms,:mss]
nreverse mss
@@ -622,7 +622,7 @@ mmCost0(name, sig,cond,tar,args1,args2) ==
topcon := first deconstructT x1
topcon2 := first deconstructT x3
topcon = topcon2 => 3
- CAR topcon2 = 'Mapping => 2
+ first topcon2 = 'Mapping => 2
4
else if sigArgs then n := n + 100000000000
@@ -645,16 +645,16 @@ orderMms(name, mmS,args1,args2,tar) ==
m < CAAR mS => CONS(p,mS)
S:= mS
until b repeat
- b:= null CDR S or m < CAADR S =>
- RPLACD(S,CONS(p,CDR S))
- S:= CDR S
+ b:= null rest S or m < CAADR S =>
+ RPLACD(S,CONS(p,rest S))
+ S:= rest S
mS
- mmS and [CDR p for p in mS]
+ mmS and [rest p for p in mS]
domainDepth(d) ==
-- computes the depth of lisp structure d
atom d => 0
- MAX(domainDepth(CAR d)+1,domainDepth(CDR d))
+ MAX(domainDepth(first d)+1,domainDepth(rest d))
hitListOfTarget(t) ==
-- assigns a number between 1 and 998 to a type t
@@ -663,23 +663,23 @@ hitListOfTarget(t) ==
t = '(Polynomial (Pi)) => 90000
- CAR t ='Polynomial => 300
- CAR t = 'List => 400
- CAR t = 'Matrix => 910
- CAR t = 'UniversalSegment => 501
- CAR t = 'RationalFunction => 900
- CAR t = 'Union => 999
- CAR t = 'Expression => 1600
+ first t ='Polynomial => 300
+ first t = 'List => 400
+ first t = 'Matrix => 910
+ first t = 'UniversalSegment => 501
+ first t = 'RationalFunction => 900
+ first t = 'Union => 999
+ first t = 'Expression => 1600
500
getFunctionFromDomain(op,dc,args) ==
-- finds the function op with argument types args in dc
-- complains, if no function or ambiguous
$reportBottomUpFlag:local:= NIL
- member(CAR dc,$nonLisplibDomains) =>
- throwKeyedMsg("S2IF0002",[CAR dc])
- not constructor? CAR dc =>
- throwKeyedMsg("S2IF0003",[CAR dc])
+ member(first dc,$nonLisplibDomains) =>
+ throwKeyedMsg("S2IF0002",[first dc])
+ not constructor? first dc =>
+ throwKeyedMsg("S2IF0003",[first dc])
p:= findFunctionInDomain(op,dc,NIL,args,args,NIL,NIL) =>
--+
--sig := [NIL,:args]
@@ -693,13 +693,13 @@ getFunctionFromDomain(op,dc,args) ==
isOpInDomain(opName,dom,nargs) ==
-- returns true only if there is an op in the given domain with
-- the given number of arguments
- mmList := ASSQ(opName,getOperationAlistFromLisplib CAR dom)
+ mmList := ASSQ(opName,getOperationAlistFromLisplib first dom)
mmList := subCopy(mmList,constructSubst dom)
null mmList => NIL
gotOne := NIL
nargs := nargs + 1
- for mm in CDR mmList while not gotOne repeat
- nargs = #CAR mm => gotOne := [mm, :gotOne]
+ for mm in rest mmList while not gotOne repeat
+ nargs = #first mm => gotOne := [mm, :gotOne]
gotOne
findCommonSigInDomain(opName,dom,nargs) ==
@@ -707,17 +707,17 @@ findCommonSigInDomain(opName,dom,nargs) ==
-- number of arguments. If no matches, returns NIL. Otherwise returns
-- a "signature" where a type position is non-NIL only if all
-- signatures shares that type .
- CAR(dom) in '(Union Record Mapping) => NIL
- mmList := ASSQ(opName,getOperationAlistFromLisplib CAR dom)
+ first(dom) in '(Union Record Mapping) => NIL
+ mmList := ASSQ(opName,getOperationAlistFromLisplib first dom)
mmList := subCopy(mmList,constructSubst dom)
null mmList => NIL
gotOne := NIL
nargs := nargs + 1
vec := NIL
- for mm in CDR mmList repeat
- nargs = #CAR mm =>
- null vec => vec := LIST2VEC CAR mm
- for i in 0.. for x in CAR mm repeat
+ for mm in rest mmList repeat
+ nargs = #first mm =>
+ null vec => vec := LIST2VEC first mm
+ for i in 0.. for x in first mm repeat
if vec.i and vec.i ~= x then vec.i := NIL
VEC2LIST vec
@@ -757,13 +757,13 @@ selectMostGeneralMm mmList ==
mml := mmList
while mml repeat
[mm,:mml] := mml
- sz := #CAR mm
+ sz := #first mm
if (met := ABS(sz - 3)) < min then
min := met
fsz := sz
- mmList := [mm for mm in mmList | (#CAR mm) = fsz]
- mml := CDR mmList
- genMm := CAR mmList
+ mmList := [mm for mm in mmList | (#first mm) = fsz]
+ mml := rest mmList
+ genMm := first mmList
while mml repeat
[mm,:mml] := mml
and/[canCoerceFrom(genMmArg,mmArg) for mmArg in CDAR mm
@@ -775,7 +775,7 @@ findFunctionInDomain(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
-- in the domain of computation dc
-- tar may be NIL (= unknown)
null isLegitimateMode(tar, nil, nil) => nil
- dcName:= CAR dc
+ dcName:= first dc
member(dcName,'(Union Record Mapping Enumeration)) =>
-- First cut code that ignores args2, $Coerce and $SubDom
-- When domains no longer have to have Set, the hard coded 6 and 7
@@ -802,7 +802,7 @@ findFunctionInDomain(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
if isHomogeneousList args1 then
q := NIL
r := NIL
- for mm in CDR p repeat
+ for mm in rest p repeat
-- CDAR of mm is the signature argument list
if isHomogeneousList CDAR mm then q := [mm,:q]
else r := [mm,:r]
@@ -810,7 +810,7 @@ findFunctionInDomain(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
for mm in q repeat
fun:= nconc(fun,findFunctionInDomain1(mm,op,tar,args1,args2,SL))
r := reverse r
- else r := CDR p
+ else r := rest p
r := allOrMatchingMms(r,args1,tar,dc)
if not fun then -- consider remaining modemaps
for mm in r repeat
@@ -837,12 +837,12 @@ allOrMatchingMms(mms,args1,tar,dc) ==
isHomogeneousList y ==
y is [x] => true
y and rest y =>
- z := CAR y
- "and"/[x = z for x in CDR y]
+ z := first y
+ "and"/[x = z for x in rest y]
NIL
findFunctionInDomain1(omm,op,tar,args1,args2,SL) ==
- dc:= CDR (dollarPair := ASSQ('$,SL))
+ dc:= rest (dollarPair := ASSQ('$,SL))
-- need to drop '$ from SL
mm:= subCopy(omm, SL)
-- tests whether modemap mm is appropriate for the function
@@ -861,7 +861,7 @@ findFunctionInDomain1(omm,op,tar,args1,args2,SL) ==
-- Unions are subsumed by total modemaps which are in the
-- mm list in findFunctionInDomain.
y := 'ELT -- if subsumed fails try it again
- not $SubDom and CAR sig isnt ['Union,:.] and slot is [tar,:args] and
+ not $SubDom and first sig isnt ['Union,:.] and slot is [tar,:args] and
(f := findFunctionInDomain(op,dc,tar,args,args,NIL,NIL)) => f
y='ELT => [[CONS(dc,sig),osig,nreverse $RTC]]
y='CONST => [[CONS(dc,sig),osig,nreverse $RTC]]
@@ -874,7 +874,7 @@ findFunctionInCategory(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
-- looks for a modemap for op with signature args1 -> tar
-- in the domain of computation dc
-- tar may be NIL (= unknown)
- dcName:= CAR dc
+ dcName:= first dc
not (dcName in '(Record Union Enumeration)) => NIL
fun:= NIL
-- cat := constructorCategory dc
@@ -928,16 +928,16 @@ matchMmSig(mm,tar,args1,args2) ==
[sig,:.]:= mm
if CONTAINED('_#, sig) then
sig := [replaceSharpCalls COPY t for t in sig]
- null args1 => matchMmSigTar(tar,CAR sig)
- a:= CDR sig
+ first args1 => matchMmSigTar(tar,first sig)
+ a:= rest sig
arg:= NIL
for i in 1.. while args1 and args2 and a until not b repeat
- x1:= CAR args1
- args1:= CDR args1
- x2:= CAR args2
- args2:= CDR args2
- x:= CAR a
- a:= CDR a
+ x1:= first args1
+ args1:= rest args1
+ x2:= first args2
+ args2:= rest args2
+ x:= first a
+ a:= rest a
rtc:= NIL
if x is ['SubDomain,y,:.] then x:= y
b := isEqualOrSubDomain(x1,x) or
@@ -946,7 +946,7 @@ matchMmSig(mm,tar,args1,args2) ==
$Coerce => x2=x or canCoerceFrom(x1,x)
x1 is ['Variable,:.] and x = $Symbol
$RTC:= CONS(rtc,$RTC)
- null args1 and null a and b and matchMmSigTar(tar,CAR sig)
+ null args1 and null a and b and matchMmSigTar(tar,first sig)
matchMmSigTar(t1,t2) ==
-- t1 is a target type specified by :: or by a declared variable
@@ -966,7 +966,7 @@ constructSubst(d) ==
-- constructs a substitution which substitutes d for $
-- and the arguments of d for #1, #2 ..
SL:= list CONS('$,d)
- for x in CDR d for i in 1.. repeat
+ for x in rest d for i in 1.. repeat
SL:= CONS(CONS(INTERNL('"#",STRINGIMAGE i),x),SL)
SL
@@ -1021,9 +1021,9 @@ selectMmsGen(op,tar,args1,args2) ==
null (S := getModemapsFromDatabase(op,QLENGTH args1)) => NIL
if (op = 'map) and (2 = #args1) and
- (CAR(args1) is ['Mapping,., elem]) and
+ (first(args1) is ['Mapping,., elem]) and
(a := isTowerWithSubdomain(second args1,elem))
- then args1 := [CAR args1,a]
+ then args1 := [first args1,a]
-- we first split the modemaps into two groups:
-- haves: these are from packages that have one of the top level
@@ -1122,14 +1122,14 @@ matchTypes(pm,args1,args2) ==
-- the result is a match from pm to args, if one exists
for v in pm for t1 in args1 for t2 in args2 until $Subst='failed repeat
p:= ASSQ(v,$Subst) =>
- t:= CDR p
+ t:= rest p
t=t1 => $Coerce and t1 = $Symbol and
(q := ASSQ(v,$SymbolType)) and t2 and
- (t3 := resolveTT(CDR q, t2)) and
+ (t3 := resolveTT(rest q, t2)) and
RPLACD(q, t3)
$Coerce =>
if t = $Symbol and (q := ASSQ(v,$SymbolType)) then
- t := CDR q
+ t := rest q
if t1 = $Symbol and t2 then t1:= t2
t0 := resolveTT(t,t1) => RPLACD(p,t0)
$Subst:= 'failed
@@ -1205,24 +1205,24 @@ evalMmCond0(op,sig,st) ==
SL:= evalMmDom st
SL='failed => 'failed
for p in SL until p1 and not b repeat b:=
- p1:= ASSQ(CAR p,$Subst)
+ p1:= ASSQ(first p,$Subst)
p1 and
- t1:= CDR p1
- t:= CDR p
+ t1:= rest p1
+ t:= rest p
t=t1 or
containsVars t =>
- if $Coerce and t1 = $Symbol then t1:= getSymbolType CAR p
+ if $Coerce and t1 = $Symbol then t1:= getSymbolType first p
resolveTM1(t1,t)
$Coerce and
-- if we are looking at the result of a function, the coerce
-- goes the opposite direction
(t1 = $AnonymousFunction and t is ['Mapping, :.]) => t
- CAR p = second sig and not member(CAR p, CDDR sig) =>
+ first p = second sig and not member(first p, CDDR sig) =>
canCoerceFrom(t,t1) => 'T
NIL
canCoerceFrom(t1,t) => 'T
isSubDomain(t,t1) => RPLACD(p,t1)
- t1 = $Symbol and canCoerceFrom(getSymbolType CAR p,t)
+ t1 = $Symbol and canCoerceFrom(getSymbolType first p,t)
( SL and p1 and not b and 'failed ) or evalMmCat(op,sig,st,SL)
fixUpTypeArgs SL ==
@@ -1240,7 +1240,7 @@ doReplaceSharpCalls t ==
ATOM t => t
t is ['_#, l] => #l
t is ['construct,: l] => EVAL ['LIST,:l]
- [CAR t,:[ doReplaceSharpCalls u for u in CDR t]]
+ [first t,:[ doReplaceSharpCalls u for u in rest t]]
noSharpCallsHere t ==
t isnt [con, :args] => true
@@ -1288,7 +1288,7 @@ evalMmDom(st) ==
for mmC in st until SL='failed repeat
mmC is ['isDomain,v,d] =>
STRINGP d => SL:= 'failed
- p:= ASSQ(v,SL) and not (d=CDR p) => SL:= 'failed
+ p:= ASSQ(v,SL) and not (d=rest p) => SL:= 'failed
d1:= subCopy(d,SL)
CONSP(d1) and MEMQ(v,d1) => SL:= 'failed
SL:= augmentSub(v,d1,SL)
@@ -1367,8 +1367,8 @@ evalMmCat1(mmC is ['ofCategory,d,c],op, SL) ==
dom =>
NSL := [CONS(d,dom)]
op ~= 'coerce => 'failed -- evalMmCatLastChance(d,c,SL)
- if containsVars dom then dom := resolveTM(CDR p, dom)
- $Coerce and canCoerce(CDR p, dom) =>
+ if containsVars dom then dom := resolveTM(rest p, dom)
+ $Coerce and canCoerce(rest p, dom) =>
NSL := [CONS(d,dom)]
op ~= 'coerce => 'failed -- evalMmCatLastChance(d,c,SL)
NSL
@@ -1378,13 +1378,13 @@ hasCate(dom,cat,SL) ==
-- augments substitution SL or returns 'failed
dom = $EmptyMode => NIL
isPatternVar dom =>
- (p:= ASSQ(dom,SL)) and ((NSL := hasCate(CDR p,cat,SL)) ~= 'failed) =>
+ (p:= ASSQ(dom,SL)) and ((NSL := hasCate(rest p,cat,SL)) ~= 'failed) =>
NSL
(p:= ASSQ(dom,$Subst)) or (p := ASSQ(dom, SL)) =>
--- S:= hasCate(CDR p,cat,augmentSub(CAR p,CDR p,copy SL))
- S:= hasCate1(CDR p,cat,SL, dom)
+-- S:= hasCate(rest p,cat,augmentSub(first p,rest p,copy SL))
+ S:= hasCate1(rest p,cat,SL, dom)
not (S='failed) => S
- hasCateSpecial(dom,CDR p,cat,SL)
+ hasCateSpecial(dom,rest p,cat,SL)
if SL ~= 'failed then $hope:= 'T
'failed
SL1 := [[v,:d] for [v,:d] in SL | not containsVariables d]
@@ -1433,7 +1433,7 @@ hasCateSpecialNew(v,dom,cat,SL) ==
fefull := fe or alg or cat = $CombinatorialFunctionCategory
partialResult :=
dom is ["Variable",:.] or dom = $Symbol =>
- CAR(cat) in
+ first(cat) in
'(SemiGroup AbelianSemiGroup Monoid AbelianGroup AbelianMonoid
PartialDifferentialRing Ring InputForm) =>
d := ['Polynomial, $Integer]
@@ -1487,8 +1487,8 @@ hasCaty(d,cat,SL) ==
for [z,:cond] in x until not (S1='failed) repeat
S' := [[p, :mkDomPvar(p, d, z, y)] for [p,:d] in S]
if $domPvar then
- dom := [CAR d, :[domArg(arg, i, z, y) for i in 0..
- for arg in CDR d]]
+ dom := [first d, :[domArg(arg, i, z, y) for i in 0..
+ for arg in rest d]]
SL := augmentSub($domPvar, dom, copy SL)
z' := [domArg2(a, S, S') for a in z]
S1:= unifyStruct(y,z',copy SL)
@@ -1585,10 +1585,10 @@ hasSig(dom,foo,sig,SL) ==
-- tests whether domain dom has function foo with signature sig
-- under substitution SL
$domPvar: local := nil
- fun:= constructor? CAR dom =>
+ fun:= constructor? first dom =>
S0:= constructSubst dom
- p := ASSQ(foo,getOperationAlistFromLisplib CAR dom) =>
- for [x,.,cond,.] in CDR p until not (S='failed) repeat
+ p := ASSQ(foo,getOperationAlistFromLisplib first dom) =>
+ for [x,.,cond,.] in rest p until not (S='failed) repeat
S:=
atom cond => copy SL
cond is ["has",a,b] =>
@@ -1608,9 +1608,9 @@ hasAtt(dom,att,SL) ==
-- tests whether dom has attribute att under SL
-- needs S0 similar to hasSig above ??
$domPvar: local := nil
- fun:= CAR dom =>
+ fun:= first dom =>
atts:= subCopy(getConstructorAttributesFromDB fun,constructSubst dom) =>
- CONSP (u := getInfovec CAR dom) =>
+ CONSP (u := getInfovec first dom) =>
--UGH! New world has attributes stored as pairs not as lists!!
for [x,:cond] in atts until not (S='failed) repeat
S:= unifyStruct(x,att,copy SL)
@@ -1638,16 +1638,16 @@ unifyStruct(s1,s2,SL) ==
s1=s2 => SL
if s1 is [":",x,.] then s1:= x
if s2 is [":",x,.] then s2:= x
- if not atom s1 and CAR s1 = '_# then s1:= LENGTH second s1
- if not atom s2 and CAR s2 = '_# then s2:= LENGTH second s2
+ if not atom s1 and first s1 = '_# then s1:= LENGTH second s1
+ if not atom s2 and first s2 = '_# then s2:= LENGTH second s2
s1=s2 => SL
isPatternVar s1 => unifyStructVar(s1,s2,SL)
isPatternVar s2 => unifyStructVar(s2,s1,SL)
atom s1 or atom s2 => 'failed
until null s1 or null s2 or SL='failed repeat
- SL:= unifyStruct(CAR s1,CAR s2,SL)
- s1:= CDR s1
- s2:= CDR s2
+ SL:= unifyStruct(first s1,first s2,SL)
+ s1:= rest s1
+ s2:= rest s2
s1 or s2 => 'failed
SL
@@ -1660,7 +1660,7 @@ unifyStructVar(v,s,SL) ==
(s0 := LASSOC(v, SL)) or (s0 := LASSOC(v,$Subst)) =>
S:= unifyStruct(s0,s1,copy SL)
S='failed =>
- $Coerce and not atom s0 and constructor? CAR s0 =>
+ $Coerce and not atom s0 and constructor? first s0 =>
containsVars s0 or containsVars s1 =>
ns0 := subCopy(s0, SL)
ns1 := subCopy(s1, SL)
@@ -1704,14 +1704,14 @@ printMms(mmS) ==
for [sig,imp,.] in mmS for i in 1.. repeat
istr := STRCONC('"[",STRINGIMAGE i,'"]")
if QCSIZE(istr) = 3 then istr := STRCONC(istr,'" ")
- sayMSG [:bright istr,'"signature: ",:formatSignature CDR sig]
- CAR sig='local =>
+ sayMSG [:bright istr,'"signature: ",:formatSignature rest sig]
+ first sig='local =>
sayMSG ['" implemented: local function ",imp]
imp is ['XLAM,:.] =>
sayMSG concat('" implemented: XLAM from ",
- prefix2String CAR sig)
+ prefix2String first sig)
sayMSG concat('" implemented: slot ",imp,
- '" from ",prefix2String CAR sig)
+ '" from ",prefix2String first sig)
sayMSG '" "
containsVars(t) ==
@@ -1736,7 +1736,7 @@ isPartialMode m ==
getSymbolType var ==
-- var is a pattern variable
- p:= ASSQ(var,$SymbolType) => CDR p
+ p:= ASSQ(var,$SymbolType) => rest p
t:= '(Polynomial (Integer))
$SymbolType:= CONS(CONS(var,t),$SymbolType)
t
@@ -1753,9 +1753,9 @@ defaultTypeForCategory(cat, SL) ==
-- might not want to use this result. For example, evalMmCat1
-- calls this and should possibly fail in some cases.
cat := subCopy(cat, SL)
- c := CAR cat
+ c := first cat
d := getConstructorDefaultFromDB c
- d => [d, :CDR cat]
+ d => [d, :rest cat]
cat is [c] =>
c = 'Field => $RationalNumber
c in '(Ring IntegralDomain EuclideanDomain GcdDomain
diff --git a/src/interp/i-intern.boot b/src/interp/i-intern.boot
index 8508b526..f419f5a4 100644
--- a/src/interp/i-intern.boot
+++ b/src/interp/i-intern.boot
@@ -120,8 +120,8 @@ mkAtree1 x ==
mkAtree2(x,op,argl) ==
nargl := #argl
- (op= "-") and (nargl = 1) and (INTEGERP CAR argl) =>
- mkAtree1(MINUS CAR argl)
+ (op= "-") and (nargl = 1) and (INTEGERP first argl) =>
+ mkAtree1(MINUS first argl)
op=":" and argl is [y,z] => [mkAtreeNode "Declare",:argl]
op="COLLECT" => [mkAtreeNode op,:transformCollect argl]
op= "break" =>
@@ -205,7 +205,7 @@ mkAtree3(x,op,argl) ==
lowTest
mkAtree1 z
x is ["IF",p,"%noBranch",a] => mkAtree1 ["IF",["not",p],a,"%noBranch"]
- x is ["RULEDEF",:.] => [mkAtreeNode "RULEDEF",:CDR x]
+ x is ["RULEDEF",:.] => [mkAtreeNode "RULEDEF",:rest x]
x is ["MDEF",sym,junk1,junk2,val] =>
-- new macros look like macro f == or macro f(x) ===
-- so transform into that format
@@ -259,7 +259,7 @@ mkAtree3(x,op,argl) ==
-- a is [op,p1,:pr] =>
-- null pr => mkAtree1 ['DEF,[op,["|",p1,pred]],:r]
-- mkAtree1 ['DEF,[op,["|",["tuple",p1,:pr],pred]],:r]
--- [mkAtreeNode 'DEF, CDR y,pred,false]
+-- [mkAtreeNode 'DEF, rest y,pred,false]
--x is ['otherwise,u] =>
-- throwMessage '" otherwise is no longer supported."
z :=
@@ -449,9 +449,9 @@ remprop(x,prop,e) ==
e
fastSearchCurrentEnv(x,currentEnv) ==
- u:= QLASSQ(x,CAR currentEnv) => u
+ u:= QLASSQ(x,first currentEnv) => u
while (currentEnv:= QCDR currentEnv) repeat
- u:= QLASSQ(x,CAR currentEnv) => u
+ u:= QLASSQ(x,first currentEnv) => u
transformCollect [:itrl,body] ==
-- syntactic transformation for COLLECT form, called from mkAtree1
diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot
index 04cdb66d..c9eec1fe 100644
--- a/src/interp/i-map.boot
+++ b/src/interp/i-map.boot
@@ -373,7 +373,7 @@ clearDep1(x,toDoList,doneList,depList) ==
a =>
depList:= delete(a,depList)
toDoList:= union(toDoList,
- setDifference(CDR a,doneList))
+ setDifference(rest a,doneList))
toDoList is [a,:res] => clearDep1(a,res,newDone,depList)
'done
@@ -391,7 +391,7 @@ outputFormat(x,m) ==
categoryForm?(m) => x
isMapExpr x => x
containsVars x => x
- atom(x) and CAR(m) = 'List => x
+ atom(x) and first(m) = 'List => x
(x is ['construct,:.]) and m = '(List (Expression)) => x
T:= coerceInteractive(objNewWrap(x,maximalSuperType(m)),
$OutputForm) or return x
@@ -444,7 +444,7 @@ simplifyMapConstructorRefs form ==
--[op,obj,APPLY('CONCAT,dom')]
dom'' :=
ATOM dom' => dom'
- NULL CDR dom' => CAR dom'
+ NULL rest dom' => first dom'
APPLY('CONCAT, dom')
[op,obj, dom'']
form
@@ -560,8 +560,8 @@ rewriteMap(op,opName,argl) ==
objNewCode(['wrap,getValueNormalForm getValue arg],
getMode arg)]
putValue(op,objNew(['rewriteMap1,MKQ opName,arglCode,MKQ sig],
- CAR sig))
- putModeSet(op,[CAR sig])
+ first sig))
+ putModeSet(op,[first sig])
rewriteMap0(op,opName,argl)
putBodyInEnv(opName, numArgs) ==
@@ -589,8 +589,8 @@ rewriteMap0(op,opName,argl) ==
for arg in argl
for var in $FormalMapVariableList repeat
if argTypes then
- t := CAR argTypes
- argTypes:= CDR argTypes
+ t := first argTypes
+ argTypes:= rest argTypes
val :=
t is ['Mapping,:.] => getValue arg
coerceInteractive(getValue arg,t)
@@ -609,8 +609,8 @@ rewriteMap1(opName,argl,sig) ==
-- compiled case of map rewriting
putBodyInEnv(opName, #argl)
if sig then
- tar:= CAR sig
- argTypes:= CDR sig
+ tar:= first sig
+ argTypes:= rest sig
else
tar:= nil
argTypes:= nil
@@ -622,8 +622,8 @@ rewriteMap1(opName,argl,sig) ==
for arg in argl for evArg in evArgl
for var in $FormalMapVariableList repeat
if argTypes then
- t:=CAR argTypes
- argTypes:= CDR argTypes
+ t:=first argTypes
+ argTypes:= rest argTypes
val :=
t is ['Mapping,:.] => evArg
coerceInteractive(evArg,t)
@@ -661,15 +661,15 @@ analyzeDeclaredMap(op,argTypes,sig,mapDef,$mapList) ==
-- mapDef is the stored form of the map body.
opName := getUnname op
$mapList:=[opName,:$mapList]
- $mapTarget := CAR sig
+ $mapTarget := first sig
(mmS:= get(opName,'localModemap,$e)) and
(mm:= or/[mm for (mm:=[[.,:mmSig],:.]) in mmS | mmSig=sig]) =>
compileCoerceMap(opName,argTypes,mm)
-- The declared map needs to be compiled
compileDeclaredMap(opName,sig,mapDef)
- argTypes ~= CDR sig =>
+ argTypes ~= rest sig =>
analyzeDeclaredMap(op,argTypes,sig,mapDef,$mapList)
- CAR sig
+ first sig
compileDeclaredMap(op,sig,mapDef) ==
-- Type analyzes and compiles a map with a declared signature.
@@ -677,18 +677,18 @@ compileDeclaredMap(op,sig,mapDef) ==
$localVars: local := nil
$freeVars: local := nil
$env:local:= [[nil]]
- parms:=[var for var in $FormalMapVariableList for m in CDR sig]
- for m in CDR sig for var in parms repeat
+ parms:=[var for var in $FormalMapVariableList for m in rest sig]
+ for m in rest sig for var in parms repeat
$env:= put(var,'mode,m,$env)
body:= getMapBody(op,mapDef)
for lvar in parms repeat mkLocalVar($mapName,lvar)
for lvar in getLocalVars(op,body) repeat mkLocalVar($mapName,lvar)
name := makeLocalModemap(op,sig)
- val := compileBody(body,CAR sig)
+ val := compileBody(body,first sig)
isRecursive := (depthOfRecursion(op,body) > 0)
putMapCode(op,objVal val,sig,name,parms,isRecursive)
genMapCode(op,objVal val,sig,name,parms,isRecursive)
- CAR sig
+ first sig
putMapCode(op,code,sig,name,parms,isRecursive) ==
-- saves the generated code and some other information about the
@@ -717,7 +717,7 @@ genMapCode(op,body,sig,fnName,parms,isRecursive) ==
op
if $verbose then
if get(op,'isInterpreterRule,$e) then
- sayKeyedMsg("S2IM0014",[op0,(CONSP sig =>prefix2String CAR sig;'"?")])
+ sayKeyedMsg("S2IM0014",[op0,(CONSP sig =>prefix2String first sig;'"?")])
else sayKeyedMsg("S2IM0015",[op0,formatSignature sig])
$whereCacheList := [op,:$whereCacheList]
@@ -750,11 +750,11 @@ compileCoerceMap(op,argTypes,mm) ==
$insideCompileBodyIfTrue: local := true
$genValue: local := false
[[.,:sig],imp,.]:= mm
- parms:= [var for var in $FormalMapVariableList for t in CDR sig]
- name:= makeLocalModemap(op,[CAR sig,:argTypes])
+ parms:= [var for var in $FormalMapVariableList for t in rest sig]
+ name:= makeLocalModemap(op,[first sig,:argTypes])
argCode := [objVal(coerceInteractive(objNew(arg,t1),t2) or
throwKeyedMsg("S2IC0001",[arg,$mapName,t1,t2]))
- for t1 in argTypes for t2 in CDR sig for arg in parms]
+ for t1 in argTypes for t2 in rest sig for arg in parms]
$insideCompileBodyIfTrue := false
parms:= [:parms,'envArg]
body := ['SPADCALL,:argCode,['LIST,['function,imp]]]
@@ -763,7 +763,7 @@ compileCoerceMap(op,argTypes,mm) ==
setDynamicBinding(minivectorName,LIST2VEC $minivector)
compileInteractive
[name,['LAMBDA,parms,declareGlobalVariables [minivectorName],:body]]
- CAR sig
+ first sig
depthOfRecursion(opName,body) ==
-- returns the "depth" of recursive calls of opName in body
@@ -824,7 +824,7 @@ analyzeRecursiveMap(op,argTypes,body,parms,n) ==
-- analyze and compile a non-recursive map definition
-- makes guess at signature by analyzing non-recursive part of body
-- then re-analyzes the entire body until the signature doesn't change
- localMapInfo := saveDependentMapInfo(op, CDR $mapList)
+ localMapInfo := saveDependentMapInfo(op, rest $mapList)
tar := CATCH('interpreter,analyzeNonRecur(op,body,$localVars))
for i in 0..n until not sigChanged repeat
sigChanged:= false
@@ -833,7 +833,7 @@ analyzeRecursiveMap(op,argTypes,body,parms,n) ==
objMode(code) ~= tar =>
sigChanged:= true
tar := objMode(code)
- restoreDependentMapInfo(op, CDR $mapList, localMapInfo)
+ restoreDependentMapInfo(op, rest $mapList, localMapInfo)
sigChanged => throwKeyedMsg("S2IM0011",[op])
putMapCode(op,objVal code,sig,name,parms,true)
genMapCode(op,objVal code,sig,name,parms,true)
@@ -935,7 +935,7 @@ notCalled(opName,form) ==
'"unknown form of function body"])
mapDefsWithCorrectArgCount(n, mapDef) ==
- [def for def in mapDef | (numArgs CAR def) = n]
+ [def for def in mapDef | (numArgs first def) = n]
numMapArgs(mapDef is [[args,:.],:.]) ==
-- returns the number of arguemnts to the map whose body is mapDef
@@ -1021,7 +1021,7 @@ findLocalVars1(op,form) ==
mkLocalVar(op,a)
form is ['is,l,pattern] =>
findLocalVars1(op,l)
- for var in listOfVariables CDR pattern repeat mkLocalVar(op,var)
+ for var in listOfVariables rest pattern repeat mkLocalVar(op,var)
form is [oper,:itrl,body] and oper in '(REPEAT COLLECT) =>
findLocalsInLoop(op,itrl,body)
form is [y,:argl] =>
diff --git a/src/interp/i-object.boot b/src/interp/i-object.boot
index b4d1952e..b9bdb21d 100644
--- a/src/interp/i-object.boot
+++ b/src/interp/i-object.boot
@@ -73,9 +73,9 @@ objNewCode(val, mode) == ["CONS", MKQ mode,val ]
objSetVal(obj,val) == RPLACD(obj,val)
objSetMode(obj,mode) == RPLACA(obj,mode)
-objVal obj == CDR obj
-objValUnwrap obj == unwrap CDR obj
-objMode obj == CAR obj
+objVal obj == rest obj
+objValUnwrap obj == unwrap rest obj
+objMode obj == first obj
objEnv obj == $EmptyEnvironment
objCodeVal obj == third obj
@@ -144,8 +144,8 @@ asTupleNewCode(eltType, size, listOfElts) ==
asTupleNewCode0(eltType,listForm) ==
["asTupleNew0", quoteForm getVMType eltType, listForm]
-asTupleSize(at) == CAR at
-asTupleAsVector(at) == CDR at
+asTupleSize(at) == first at
+asTupleAsVector(at) == rest at
asTupleAsList(at) == VEC2LIST asTupleAsVector at
--% Basic Object Type Identification
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index e4b96a90..b2e29cb8 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -1141,12 +1141,12 @@ maprinChk x ==
null $MatrixList => maPrin x
ATOM x and (u:= assoc(x,$MatrixList)) =>
$MatrixList := delete(u,$MatrixList)
- maPrin deMatrix CDR u
+ maPrin deMatrix rest u
x is ["=",arg,y] => --case for tracing with )math and printing matrices
u:=assoc(y,$MatrixList) =>
-- we don't want to print matrix1 = matrix2 ...
$MatrixList := delete(u,$MatrixList)
- maPrin ["=",arg, deMatrix CDR u]
+ maPrin ["=",arg, deMatrix rest u]
maPrin x
x is ['EQUATNUM,n,y] =>
$MatrixList is [[name,:value]] and y=name =>
@@ -1200,7 +1200,7 @@ LargeMatrixp(u,width, dist) ==
dist:=dist-3
width:=width-3
ans:=
- for v in CDR u repeat
+ for v in rest u repeat
(ans:=LargeMatrixp(v,width,dist)) => return largeMatrixAlist ans
dist:=dist - WIDTH v
dist<0 => return nil
@@ -1219,7 +1219,7 @@ LargeMatrixp(u,width, dist) ==
ans
--Relying that falling out of a loop gives nil
ans:=
- for v in CDR u repeat
+ for v in rest u repeat
(ans:=LargeMatrixp(v,width,dist)) => return largeMatrixAlist ans
dist:=dist - WIDTH v
dist<0 => return nil
@@ -1236,7 +1236,7 @@ PushMatrix m ==
--Adds the matrix to the look-aside list, and returns a name for it
name:=
for v in $MatrixList repeat
- EQUAL(m,CDR v) => return CAR v
+ EQUAL(m,rest v) => return first v
name => name
name:=INTERNL('"matrix",STRINGIMAGE($MatrixCount:=$MatrixCount+1))
$MatrixList:=[[name,:m],:$MatrixList]
@@ -1260,9 +1260,9 @@ SubstWhileDesizing(u,m) ==
-- doesn't work since RASSOC seems to use an EQ test, and returns the
-- pair anyway. JHD 28/2/93
op = 'MATRIX =>
- l':=SubstWhileDesizingList(CDR l,m)
+ l':=SubstWhileDesizingList(rest l,m)
u :=
- -- CDR l=l' => u
+ -- rest l=l' => u
-- this was a CONS-saving optimisation, but it doesn't work JHD 28/2/93
[op,nil,:l']
PushMatrix u
@@ -1289,7 +1289,7 @@ SubstWhileDesizingList(u,m) ==
tail:=res
for i in b repeat
if ATOM i then RPLACD(tail,[i]) else RPLACD(tail,[SubstWhileDesizing(i,m)])
- tail:=CDR tail
+ tail:=rest tail
res
u
@@ -2166,14 +2166,14 @@ boxSub(x) ==
subspan x.1+1
boxSuper(x) ==
- null CDR x => 0
+ null rest x => 0
hl :=
null CDDR x => 0
true => 2 + subspan x.2 + superspan x.2
true => hl+1 + superspan x.1
boxWidth(x) ==
- null CDR x => 0
+ null rest x => 0
wl :=
null CDDR x => 0
true => WIDTH x.2
@@ -2718,5 +2718,5 @@ str2Tex s ==
outf := str2Outform s
val := coerceInt(objNew(wrap outf, '(OutputForm)), '(TexFormat))
val := objValUnwrap val
- CAR val.1
+ first val.1
diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot
index dbd07152..e71472ae 100644
--- a/src/interp/i-resolv.boot
+++ b/src/interp/i-resolv.boot
@@ -154,7 +154,7 @@ resolveTTUnion(t1 is ['Union,:doms],t2) ==
for d in doms2 while not bad repeat
d = '"failed" => ud := append(ud,[d])
null (d' := resolveTTUnion(t1,d)) => bad := true
- ud := append(ud,CDR d')
+ ud := append(ud,rest d')
bad => NIL
['Union,:REMDUP ud]
@@ -165,7 +165,7 @@ resolveTTSpecial(t1,t2) ==
-- following is just an efficiency hack
(t1 = $Symbol or t1 is ['OrderedVariableList,.]) and CONSP(t2) and
- CAR(t2) in '(Polynomial RationalFunction) => t2
+ first(t2) in '(Polynomial RationalFunction) => t2
(t1 = $Symbol) and ofCategory(t2, '(IntegerNumberSystem)) =>
resolveTT1(['Polynomial, t2], t2)
@@ -277,10 +277,10 @@ resolveTTEq1(c1,arg1,TL is [c2,arg2,:.]) ==
c1=c2 and
[c2,arg2,:TL] := bubbleType TL
until null arg1 or null arg2 or not t repeat
- t := resolveTT1(CAR arg1,CAR arg2) =>
+ t := resolveTT1(first arg1,first arg2) =>
arg := CONS(t,arg)
- arg1 := CDR arg1
- arg2 := CDR arg2
+ arg1 := rest arg1
+ arg2 := rest arg2
t and null arg1 and null arg2 and
t0 := constructM(c1,nreverse arg)
constructTowerT(t0,TL)
@@ -345,7 +345,7 @@ resolveTTRed3(t) ==
interpOp?(op) ==
CONSP(op) and
- CAR(op) in '(Incl SetDiff SetComp SetInter SetUnion VarEqual SetEqual)
+ first(op) in '(Incl SetDiff SetComp SetInter SetUnion VarEqual SetEqual)
--% Resolve Type with Category
@@ -413,7 +413,7 @@ getConditionalCategoryOfType(t,conditions,match) ==
if CONSP t then t := first t
t in '(Union Mapping Record) => NIL
conCat := getConstructorCategoryFromDB t
- REMDUP CDR getConditionalCategoryOfType1(conCat,conditions,match,[NIL])
+ REMDUP rest getConditionalCategoryOfType1(conCat,conditions,match,[NIL])
getConditionalCategoryOfType1(cat,conditions,match,seen) ==
cat is ['Join,:cs] or cat is ['CATEGORY,:cs] =>
@@ -423,12 +423,12 @@ getConditionalCategoryOfType1(cat,conditions,match,seen) ==
match,seen)
cat is ['IF,., cond,.] =>
matchUpToPatternVars(cond,match,NIL) =>
- RPLACD(conditions,CONS(cat,CDR conditions))
+ RPLACD(conditions,CONS(cat,rest conditions))
conditions
conditions
cat is [catName,:.] and (getConstructorKindFromDB catName = "category") =>
- member(cat, CDR seen) => conditions
- RPLACD(seen,[cat,:CDR seen])
+ member(cat, rest seen) => conditions
+ RPLACD(seen,[cat,:rest seen])
subCat := getConstructorCategoryFromDB catName
-- substitute vars of cat into category
for v in rest cat for vv in $TriangleVariableList repeat
@@ -444,13 +444,13 @@ matchUpToPatternVars(pat,form,patAlist) ==
EQUAL(pat,form) => true
isSharpVarWithNum(pat) =>
-- see is pattern variable is in alist
- (p := assoc(pat,patAlist)) => EQUAL(form,CDR p)
+ (p := assoc(pat,patAlist)) => EQUAL(form,rest p)
patAlist := [[pat,:form],:patAlist]
true
CONSP(pat) =>
atom form => NIL
- matchUpToPatternVars(CAR pat, CAR form,patAlist) and
- matchUpToPatternVars(CDR pat, CDR form,patAlist)
+ matchUpToPatternVars(first pat, first form,patAlist) and
+ matchUpToPatternVars(rest pat, rest form,patAlist)
NIL
--% Resolve Type with Mode
@@ -486,9 +486,9 @@ resolveTM1(t,m) ==
isPatternVar m =>
p := ASSQ(m,$Subst) =>
$Coerce =>
- tt := resolveTT1(t,CDR p) => RPLACD(p,tt) and tt
+ tt := resolveTT1(t,rest p) => RPLACD(p,tt) and tt
NIL
- t=CDR p and t
+ t=rest p and t
$Subst := CONS(CONS(m,t),$Subst)
t
atom(t) or atom(m) => NIL
@@ -514,7 +514,7 @@ resolveTMRecord(tr,mr) ==
second(ta) ~= second(ma) => ok := NIL -- match tags
ra := resolveTM1(third ta, third ma) -- resolve modes
null ra => ok := NIL
- tt := CONS([CAR ta,second ta,ra],tt)
+ tt := CONS([first ta,second ta,ra],tt)
null ok => NIL
['Record,nreverse tt]
@@ -544,7 +544,7 @@ resolveTMUnion(t, m is ['Union,:ums]) ==
doms := nil
for ut in uts while not bad repeat
(m' := resolveTMUnion(ut,['Union,:ums])) =>
- doms := append(CDR m',doms)
+ doms := append(rest m',doms)
bad := true
bad => NIL
['Union,:REMDUP doms]
@@ -587,7 +587,7 @@ resolveTMEq(t,m) ==
t := argt and last argt
b and
t := resolveTMEq2(cm,argm,[ct,argt,:TL])
- if t then for p in SL repeat $Subst := augmentSub(CAR p,CDR p,$Subst)
+ if t then for p in SL repeat $Subst := augmentSub(first p,rest p,$Subst)
t
resolveTMSpecial(t,m) ==
@@ -616,25 +616,25 @@ resolveTMEq1(ct,cm) ==
-- ct and cm are type constructors
-- tests for a match from cm to ct
-- the result is a substitution or 'failed
- not (CAR ct=CAR cm) => 'failed
+ not (first ct=first cm) => 'failed
SL := NIL
- ct := CDR ct
- cm := CDR cm
+ ct := rest ct
+ cm := rest cm
b := 'T
while ct and cm and b repeat
- xt := CAR ct
- ct := CDR ct
- xm := CAR cm
- cm := CDR cm
- if not (atom xm) and CAR xm = ":" -- i.e. Record
- and CAR xt = ":" and second xm = second xt then
+ xt := first ct
+ ct := rest ct
+ xm := first cm
+ cm := rest cm
+ if not (atom xm) and first xm = ":" -- i.e. Record
+ and first xt = ":" and second xm = second xt then
xm := third xm
xt := third xt
b :=
xt=xm => 'T
isPatternVar(xm) and
- p := ASSQ(xm,$Subst) => xt=CDR p
- p := ASSQ(xm,SL) => xt=CDR p
+ p := ASSQ(xm,$Subst) => xt=rest p
+ p := ASSQ(xm,SL) => xt=rest p
SL := augmentSub(xm,xt,SL)
b => SL
'failed
@@ -650,10 +650,10 @@ resolveTMEq2(cm,argm,TL) ==
-- null argm => NIL
arg := NIL
while argt and argm until not tt repeat
- x1 := CAR argt
- argt := CDR argt
- x2 := CAR argm
- argm := CDR argm
+ x1 := first argt
+ argt := rest argt
+ x2 := first argm
+ argm := rest argm
tt := resolveTM1(x1,x2) =>
arg := CONS(tt,arg)
null argt and null argm and tt and constructM(ct,nreverse arg)
@@ -719,8 +719,8 @@ getUnderModeOf d ==
--deconstructM(t) ==
-- -- M is a type, which may contain type variables
-- -- results in a pair (type constructor . mode arguments)
--- CDR t and constructor? CAR t =>
--- dt := destructT CAR t
+-- rest t and constructor? first t =>
+-- dt := destructT first t
-- args := [ x for d in dt for y in t | ( x := d and y ) ]
-- c := [ x for d in dt for y in t | ( x := not d and y ) ]
-- CONS(c,args)
@@ -738,14 +738,14 @@ deconstructT(t) ==
constructT(c,A) ==
-- c is a type constructor, A a list of argument types
- A => [if d then POP A else POP c for d in destructT CAR c]
+ A => [if d then POP A else POP c for d in destructT first c]
c
constructM(c,A) ==
-- replaces top level RE's or QF's by equivalent types, if possible
containsVars(c) or containsVars(A) => NIL
-- collapses illegal FE's
- CAR(c) = $FunctionalExpression => eqType defaultTargetFE CAR A
+ first(c) = $FunctionalExpression => eqType defaultTargetFE first A
eqType constructT(c,A)
replaceLast(A,t) ==
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index b99da141..60eb4fe5 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -121,9 +121,9 @@ evalTargetedADEF(t,vars,types,body) ==
sublist := [[var,:GENSYM()] for var in vars]
body := sublisNQ(sublist,body)
- vars := [CDR v for v in sublist]
+ vars := [rest v for v in sublist]
- for m in CDR types for var in vars repeat
+ for m in rest types for var in vars repeat
$env:= put(var,'mode,m,$env)
mkLocalVar($mapName,var)
for lvar in getLocalVars($mapName,body) repeat
@@ -145,7 +145,7 @@ mkInterpTargetedADEF(t,vars,types,oldBody) ==
compileADEFBody(t,vars,types,body,first types)
compileTargetedADEF(t,vars,types,body) ==
- val := compileBody(body,CAR types)
+ val := compileBody(body,first types)
computedResultType := objMode val
body := wrapMapBodyWithCatch flattenCOND objVal val
compileADEFBody(t,vars,types,body,computedResultType)
@@ -513,8 +513,8 @@ upLoopIterIN(iter,index,s) ==
NIL
upLoopIterSTEP(index,lower,step,upperList)
newIter := ['STEP,index,lower,step,:upperList]
- RPLACA(iter,CAR newIter)
- RPLACD(iter,CDR newIter)
+ RPLACA(iter,first newIter)
+ RPLACD(iter,rest newIter)
iterMs isnt [['List,ud]] => throwKeyedMsg("S2IS0006",[index])
put(index,'mode,ud,$env)
@@ -686,8 +686,8 @@ upStreamIterIN(iter,index,s) ==
NIL
upStreamIterSTEP(index,lower,step,upperList)
newIter := ['STEP,index,lower,step,:upperList]
- RPLACA(iter,CAR newIter)
- RPLACD(iter,CDR newIter)
+ RPLACA(iter,first newIter)
+ RPLACD(iter,rest newIter)
(iterMs isnt [['List,ud]]) and (iterMs isnt [['Stream,ud]])
and (iterMs isnt [['InfinitTuple, ud]]) =>
@@ -741,7 +741,7 @@ collectOneStream(t,op,itrl,body) ==
-- build stream collect for case of iterating over a single stream
-- In this case we don't need to build records
form := mkAndApplyPredicates itrl
- bodyVec := mkIterFun(CAR $indexVars,body,$localVars)
+ bodyVec := mkIterFun(first $indexVars,body,$localVars)
form := [mkAtreeNode 'map,bodyVec,form]
bottomUp form
val := getValue form
@@ -808,7 +808,7 @@ checkForFreeVariables(v,locals) ==
["getSimpleArrayEntry","envArg",positionInVec(0,#($freeVariables))]
v
LISTP v =>
- CDR(LASTTAIL v) => -- Must be a better way to check for a genuine list?
+ rest(LASTTAIL v) => -- Must be a better way to check for a genuine list?
v
[op,:args] := v
LISTP op =>
@@ -885,7 +885,7 @@ mkZipCode indexList ==
mkAtreeNode 'makeRecord]
form := [mkAtreeNode 'map,zipFun,s1,s2]
[form,:zipType]
- [form,:zipType] := mkZipCode CDR indexList
+ [form,:zipType] := mkZipCode rest indexList
[[.,:s],:.] := indexList
t := second objMode getValue s
zipFun := [mkAtreeNode 'Dollar, ['MakeRecord,mkEvalable t,
@@ -935,7 +935,7 @@ subVecNodes(new,old,form) ==
ATOM form =>
(VECP form) and (form.0 = old) => new
form
- [subVecNodes(new,old,CAR form), :subVecNodes(new,old,CDR form)]
+ [subVecNodes(new,old,first form), :subVecNodes(new,old,rest form)]
mkIterVarSub(var,numVars) ==
n := iterVarPos var
@@ -966,12 +966,12 @@ upconstruct t ==
isTaggedUnion tar => upTaggedUnionConstruct(op,l,tar)
aggs := '(List)
if tar and CONSP(tar) and not isPartialMode(tar) then
- CAR(tar) in aggs =>
+ first(tar) in aggs =>
ud :=
(l is [[realOp, :.]]) and (getUnname(realOp) = 'COLLECT) => tar
second tar
for x in l repeat if not getTarget(x) then putTarget(x,ud)
- CAR(tar) in '(Matrix SquareMatrix RectangularMatrix) =>
+ first(tar) in '(Matrix SquareMatrix RectangularMatrix) =>
vec := ['List,underDomainOf tar]
for x in l repeat if not getTarget(x) then putTarget(x,vec)
nargs := #l
@@ -1184,11 +1184,11 @@ replaceSharps(x,d) ==
-- replaces all sharps in x by the arguments of domain d
-- all replaces the triangle variables
SL:= NIL
- for e in CDR d for var in $FormalMapVariableList repeat
+ for e in rest d for var in $FormalMapVariableList repeat
SL:= CONS(CONS(var,e),SL)
x := subCopy(x,SL)
SL:= NIL
- for e in CDR d for var in $TriangleVariableList repeat
+ for e in rest d for var in $TriangleVariableList repeat
SL:= CONS(CONS(var,e),SL)
subCopy(x,SL)
@@ -1268,6 +1268,6 @@ listOfDuplicates l ==
deleteAll(x,l) ==
null l => nil
- x = CAR(l) => deleteAll(x,CDR l)
+ x = first(l) => deleteAll(x,rest l)
[first l,:deleteAll(x,rest l)]
diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot
index cd444eca..0645635b 100644
--- a/src/interp/i-spec2.boot
+++ b/src/interp/i-spec2.boot
@@ -138,7 +138,7 @@ upDollar t ==
if x then putTarget(y,x)
putAtree(first form,"dollar",t)
ms := bottomUp form
- f in '(One Zero) and CONSP (ms) and CAR(ms) = $OutputForm =>
+ f in '(One Zero) and CONSP (ms) and first(ms) = $OutputForm =>
throwKeyedMsg("S2IS0021",[f,t])
putValue(op,getValue first form)
putModeSet(op,ms)
@@ -399,7 +399,7 @@ compileIs(val,pattern) ==
-- produce code for compiled "is" predicate. makes pattern variables
-- into local variables of the function
vars:= NIL
- for pat in CDR pattern repeat
+ for pat in rest pattern repeat
IDENTP(pat) and isLocalVar(pat) => vars:=[pat,:vars]
pat is [":",var] => vars:= [var,:vars]
pat is ["=",var] => vars:= [var,:vars]
@@ -432,8 +432,8 @@ removeConstruct pat ==
if pat is ["construct",:p] then pat:=p
if pat is ["cons", a, b] then pat := [a, [":", b]]
atom pat => pat
- RPLACA(pat,removeConstruct CAR pat)
- RPLACD(pat,removeConstruct CDR pat)
+ RPLACA(pat,removeConstruct first pat)
+ RPLACD(pat,removeConstruct rest pat)
pat
isPatternMatch(l,pats) ==
@@ -457,7 +457,7 @@ isPatMatch(l,pats) ==
isPatMatch(rest l,restPats)
pat is ["=",var] =>
p:=ASSQ(var,$subs) =>
- CAR l = CDR p => isPatMatch(rest l, restPats)
+ first l = rest p => isPatMatch(rest l, restPats)
$subs:="failed"
$subs:="failed"
pat is [":",var] =>
@@ -789,7 +789,7 @@ assignSymbol(symbol, value, domain) ==
getInterpMacroNames() ==
names := [n for [n,:.] in $InterpreterMacroAlist]
if (e := CAAR $InteractiveFrame) and (m := assoc("--macros--",e)) then
- names := append(names,[n for [n,:.] in CDR m])
+ names := append(names,[n for [n,:.] in rest m])
MSORT names
isInterpMacro name ==
@@ -800,7 +800,7 @@ isInterpMacro name ==
(m := get("--macros--",name,$e)) => m
(m := get("--macros--",name,$InteractiveFrame)) => m
-- $InterpreterMacroAlist will probably be phased out soon
- (sv := assoc(name,$InterpreterMacroAlist)) => CONS(NIL,CDR sv)
+ (sv := assoc(name,$InterpreterMacroAlist)) => CONS(NIL,rest sv)
NIL
--% Handlers for prefix QUOTE
@@ -860,7 +860,7 @@ getReduceFunction(op,type,result, locale) ==
(isHomogeneousArgs sig) and "and"/[null c for c in cond]]
null mm => 'failed
[[dc,:sig],fun,:.]:=mm
- dc='local => [MKQ [fun,:'local],:CAR sig]
+ dc='local => [MKQ [fun,:'local],:first sig]
dcVector := evalDomain dc
$compilingMap =>
k := NRTgetMinivectorIndex(
@@ -1076,10 +1076,10 @@ uptuple t ==
isTaggedUnion tar => upTaggedUnionConstruct(op,l,tar)
aggs := '(List)
if tar and CONSP(tar) and not isPartialMode(tar) then
- CAR(tar) in aggs =>
+ first(tar) in aggs =>
ud := second tar
for x in l repeat if not getTarget(x) then putTarget(x,ud)
- CAR(tar) in '(Matrix SquareMatrix RectangularMatrix) =>
+ first(tar) in '(Matrix SquareMatrix RectangularMatrix) =>
vec := ['List,underDomainOf tar]
for x in l repeat if not getTarget(x) then putTarget(x,vec)
argModeSetList:= [bottomUp x for x in l]
@@ -1147,7 +1147,7 @@ upwhere t ==
tree := upwhereMkAtree(tree,env,e)
if x := getAtree(op,'dollar) then
atom tree => throwKeyedMsg("S2IS0048",NIL)
- putAtree(CAR tree,'dollar,x)
+ putAtree(first tree,'dollar,x)
upwhereMain(tree,env,e)
val := getValue tree
putValue(op,val)
@@ -1175,7 +1175,7 @@ copyHack(env) ==
-- (localModemap . something)
c:= CAAR env
d:= [fn p for p in c] where fn(p) ==
- CONS(CAR p,[(q is ["localModemap",:.] => q; copy q) for q in CDR p])
+ CONS(first p,[(q is ["localModemap",:.] => q; copy q) for q in rest p])
[[d]]
diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
index 0a06f418..c473e2e1 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -44,7 +44,7 @@ $sourceFileTypes := '(INPUT SPAD BOOT LISP LISP370 META)
$existingFiles := MAKE_-HASHTABLE "UEQUAL"
-$SYSCOMMANDS := [CAR x for x in $systemCommands]
+$SYSCOMMANDS := [first x for x in $systemCommands]
$NonNullStream ==
'"NonNullStream"
@@ -100,7 +100,7 @@ initializeSystemCommands() ==
$SYSCOMMANDS := NIL
while l repeat
$SYSCOMMANDS := CONS(CAAR l, $SYSCOMMANDS)
- l := CDR l
+ l := rest l
$SYSCOMMANDS := NREVERSE $SYSCOMMANDS
systemCommand [[op,:argl],:options] ==
@@ -125,7 +125,7 @@ synonymsForUserLevel l ==
$UserLevel = 'development => l
nl := NIL
for syn in reverse l repeat
- cmd := STRING2ID_-N(CDR syn,1)
+ cmd := STRING2ID_-N(rest syn,1)
null selectOptionLC(cmd,commandsForUserLevel
$systemCommands,NIL) => nil
nl := [syn,:nl]
@@ -151,7 +151,7 @@ hasOption(al,opt) ==
optPname:= PNAME opt
found := NIL
for pair in al while not found repeat
- stringPrefix?(PNAME CAR pair,optPname) => found := pair
+ stringPrefix?(PNAME first pair,optPname) => found := pair
found
selectOptionLC(x,l,errorFunction) ==
@@ -227,7 +227,7 @@ abbreviationsSpad2Cmd l ==
opt = 'quiet => quiet := true
l is [opt,:al] =>
- key := opOf CAR al
+ key := opOf first al
type := selectOptionLC(opt,abopts,'optionError)
type is 'query =>
null al => listConstructorAbbreviations()
@@ -364,13 +364,13 @@ clearCmdParts(l is [opt,:vl]) ==
(lm := get(x,'localModemap,$InteractiveFrame)) =>
CONSP lm => untraceMapSubNames [CADAR lm]
NIL
- for p2 in CDR p1 repeat
- prop:= CAR p2
- recordOldValue(x,prop,CDR p2)
+ for p2 in rest p1 repeat
+ prop:= first p2
+ recordOldValue(x,prop,rest p2)
recordNewValue(x,prop,NIL)
SETF(CAAR $InteractiveFrame,deleteAssoc(x,CAAR $InteractiveFrame))
- p2:= assoc(option,CDR p1) =>
- recordOldValue(x,option,CDR p2)
+ p2:= assoc(option,rest p1) =>
+ recordOldValue(x,option,rest p2)
recordNewValue(x,option,NIL)
RPLACD(p2,NIL)
nil
@@ -1080,7 +1080,7 @@ displayMacros names ==
NIL
getParserMacroNames() ==
- REMDUP [CAR mac for mac in getParserMacros()]
+ REMDUP [first mac for mac in getParserMacros()]
clearParserMacro(macro) ==
-- first see if it is one
@@ -1282,7 +1282,7 @@ edit l == editSpad2Cmd l
editSpad2Cmd l ==
l:=
null l => _/EDITFILE
- CAR l
+ first l
l := pathname STRING l
oldDir := pathnameDirectory l
fileTypes :=
@@ -1350,7 +1350,7 @@ $previousBindings := nil
frame l == frameSpad2Cmd l
-frameName(frame) == CAR frame
+frameName(frame) == first frame
frameNames() == [frameName f for f in $interpreterFrameRing]
@@ -1501,7 +1501,7 @@ changeToNamedInterpreterFrame(name) ==
findFrameInRing(name) ==
val := NIL
for frame in $interpreterFrameRing repeat
- CAR frame = name =>
+ first frame = name =>
val := frame
return frame
val
@@ -1682,7 +1682,7 @@ writeInputLines(fn,initial) ==
maxn := 72
breakChars := [" ","+"]
for i in initial..$IOindex - 1 repeat
- vecl := CAR readHiFi i
+ vecl := first readHiFi i
if STRINGP vecl then vecl := [vecl]
for vec in vecl repeat
n := SIZE vec
@@ -1714,7 +1714,7 @@ resetInCoreHist() ==
-- removes all pointers from $HistList
$HistListAct:= 0
for i in 1..$HistListLen repeat
- $HistList:= CDR $HistList
+ $HistList:= rest $HistList
RPLACA($HistList,NIL)
changeHistListLen(n) ==
@@ -1722,11 +1722,11 @@ changeHistListLen(n) ==
NULL INTEGERP n => sayKeyedMsg("S2IH0015",[n])
dif:= n-$HistListLen
$HistListLen:= n
- l:= CDR $HistList
+ l:= rest $HistList
if dif > 0 then
for i in 1..dif repeat l:= CONS(NIL,l)
if dif < 0 then
- for i in 1..-dif repeat l:= CDR l
+ for i in 1..-dif repeat l:= rest l
if $HistListAct > n then $HistListAct:= n
RPLACD($HistList,l)
'done
@@ -1747,7 +1747,7 @@ updateHist() ==
updateInCoreHist() ==
-- updates $HistList and $IOindex
- $HistList:= CDR($HistList)
+ $HistList:= rest($HistList)
RPLACA($HistList,NIL)
if $HistListAct < $HistListLen then $HistListAct:= $HistListAct+1
@@ -1772,9 +1772,9 @@ recordNewValue0(x,prop,val) ==
-- writes (prop . val) into $HistRecord
-- updateHist writes this stuff out into the history file
p1:= ASSQ(x,$HistRecord) =>
- p2:= ASSQ(prop,CDR p1) =>
+ p2:= ASSQ(prop,rest p1) =>
RPLACD(p2,val)
- RPLACD(p1,CONS(CONS(prop,val),CDR p1))
+ RPLACD(p1,CONS(CONS(prop,val),rest p1))
p:= CONS(x,list CONS(prop,val))
$HistRecord:= CONS(p,$HistRecord)
@@ -1785,35 +1785,35 @@ recordOldValue(x,prop,val) ==
recordOldValue0(x,prop,val) ==
-- writes (prop . val) into $HistList
- p1:= ASSQ(x,CAR $HistList) =>
- not ASSQ(prop,CDR p1) =>
- RPLACD(p1,CONS(CONS(prop,val),CDR p1))
+ p1:= ASSQ(x,first $HistList) =>
+ not ASSQ(prop,rest p1) =>
+ RPLACD(p1,CONS(CONS(prop,val),rest p1))
p:= CONS(x,list CONS(prop,val))
- RPLACA($HistList,CONS(p,CAR $HistList))
+ RPLACA($HistList,CONS(p,first $HistList))
undoInCore(n) ==
-- undoes the last n>0 steps using $HistList
-- resets $InteractiveFrame
li:= $HistList
- for i in n..$HistListLen repeat li:= CDR li
+ for i in n..$HistListLen repeat li:= rest li
undoChanges(li)
n:= $IOindex-n-1
n>0 and
$HiFiAccess =>
- vec:= CDR UNWIND_-PROTECT(readHiFi(n),disableHist())
- val:= ( p:= ASSQ('%,vec) ) and ( p1:= ASSQ('value,CDR p) ) and
- CDR p1
+ vec:= rest UNWIND_-PROTECT(readHiFi(n),disableHist())
+ val:= ( p:= ASSQ('%,vec) ) and ( p1:= ASSQ('value,rest p) ) and
+ rest p1
sayKeyedMsg("S2IH0019",[n])
$InteractiveFrame:= putHist('%,'value,val,$InteractiveFrame)
updateHist()
undoChanges(li) ==
-- undoes all changes of list 'li'
- if not CDR li = $HistList then undoChanges CDR li
- for p1 in CAR li repeat
- x:= CAR p1
- for p2 in CDR p1 repeat
- putHist(x,CAR p2,CDR p2,$InteractiveFrame)
+ if not rest li = $HistList then undoChanges rest li
+ for p1 in first li repeat
+ x:= first p1
+ for p2 in rest p1 repeat
+ putHist(x,first p2,rest p2,$InteractiveFrame)
undoFromFile(n) ==
-- makes a clear and redoes all the assignments until step n
@@ -1825,12 +1825,12 @@ undoFromFile(n) ==
if $HiFiAccess then recordNewValue(x,prop,val)
RPLACD(p,NIL)
for i in 1..n repeat
- vec:= UNWIND_-PROTECT(CDR readHiFi(i),disableHist())
+ vec:= UNWIND_-PROTECT(rest readHiFi(i),disableHist())
for p1 in vec repeat
- x:= CAR p1
- for p2 in CDR p1 repeat
- $InteractiveFrame:= putHist(x,CAR p2,CDR p2,$InteractiveFrame)
- val:= ( p:= ASSQ('%,vec) ) and ( p1:= ASSQ('value,CDR p) ) and CDR p1
+ x:= first p1
+ for p2 in rest p1 repeat
+ $InteractiveFrame:= putHist(x,first p2,rest p2,$InteractiveFrame)
+ val:= ( p:= ASSQ('%,vec) ) and ( p1:= ASSQ('value,rest p) ) and CDR p1
$InteractiveFrame:= putHist('%,'value,val,$InteractiveFrame)
updateHist()
@@ -1884,11 +1884,11 @@ restoreHistory(fn) ==
vec:= UNWIND_-PROTECT(readHiFi(i),disableHist())
if oldInternal then $internalHistoryTable :=
CONS([i,:vec],$internalHistoryTable)
- LINE:= CAR vec
- for p1 in CDR vec repeat
- x:= CAR p1
- for p2 in CDR p1 repeat
- $InteractiveFrame:= putHist(x,CAR p2,CDR p2,$InteractiveFrame)
+ LINE:= first vec
+ for p1 in rest vec repeat
+ x:= first p1
+ for p2 in rest p1 repeat
+ $InteractiveFrame:= putHist(x,first p2,rest p2,$InteractiveFrame)
updateInCoreHist()
$e := $InteractiveFrame
for [a,:.] in CAAR $InteractiveFrame repeat
@@ -1923,7 +1923,7 @@ showHistory(arg) ==
n := 20
nset := nil
if arg then
- arg1 := CAR arg
+ arg1 := first arg
if INTEGERP arg1 then
n := arg1
nset := true
@@ -1951,9 +1951,9 @@ showInput(mini,maxi) ==
for ind in mini..maxi repeat
vec:= UNWIND_-PROTECT(readHiFi(ind),disableHist())
if ind<10 then TAB 2 else if ind<100 then TAB 1
- l := CAR vec
+ l := first vec
STRINGP l =>
- sayMSG ['" [",ind,'"] ",CAR vec]
+ sayMSG ['" [",ind,'"] ",first vec]
sayMSG ['" [",ind,'"] " ]
for ln in l repeat
sayMSG ['" ", ln]
@@ -1962,9 +1962,9 @@ showInOut(mini,maxi) ==
-- displays all steps from mini to maxi
for ind in mini..maxi repeat
vec:= UNWIND_-PROTECT(readHiFi(ind),disableHist())
- sayMSG [CAR vec]
- Alist:= ASSQ('%,CDR vec) =>
- triple:= CDR ASSQ('value,CDR Alist)
+ sayMSG [first vec]
+ Alist:= ASSQ('%,rest vec) =>
+ triple:= rest ASSQ('value,rest Alist)
$IOindex:= ind
spadPrint(objValUnwrap triple,objMode triple)
@@ -1978,8 +1978,8 @@ fetchOutput(n) ==
n >= $IOindex => throwKeyedMsg("S2IH0001",[n])
n < 1 => throwKeyedMsg("S2IH0002",[n])
vec:= UNWIND_-PROTECT(readHiFi(n),disableHist())
- Alist:= ASSQ('%,CDR vec) =>
- val:= CDR ASSQ('value,CDR Alist) => val
+ Alist:= ASSQ('%,rest vec) =>
+ val:= rest ASSQ('value,rest Alist) => val
throwKeyedMsg("S2IH0003",[n])
throwKeyedMsg("S2IH0003",[n])
throwKeyedMsg("S2IH0004",NIL)
@@ -2161,7 +2161,7 @@ dewritify ob ==
null ob => nil
e := HGET($seen, ob) => e
- CONSP ob and CAR ob = 'WRITIFIED_!_! =>
+ CONSP ob and first ob = 'WRITIFIED_!_! =>
type := ob.1
type = 'SELF =>
'WRITIFIED_!_!
@@ -2475,7 +2475,7 @@ reportOpsFromLisplib1(unitForm,u) ==
reportOpsFromUnitDirectly unitForm ==
isRecordOrUnion := unitForm is [a,:.] and a in '(Record Union)
unit:= evalDomain unitForm
- top:= CAR unitForm
+ top:= first unitForm
kind:= getConstructorKindFromDB top
sayBrightly concat('%b,formatOpType unitForm,
@@ -2620,7 +2620,7 @@ synonymSpad2Cmd() ==
else
pair := processSynonymLine line
if $CommandSynonymAlist then
- PUTALIST($CommandSynonymAlist,CAR pair, CDR pair)
+ PUTALIST($CommandSynonymAlist,first pair, rest pair)
else $CommandSynonymAlist := [pair]
terminateSystemCommand()
@@ -2676,7 +2676,7 @@ recordFrame(systemNormal) ==
delta := ['systemCommand,:delta]
$frameRecord := [delta,:$frameRecord]
$previousBindings := --copy all but the individual properties
- [CONS(CAR x,[CONS(CAR y,CDR y) for y in CDR x]) for x in CAAR $InteractiveFrame]
+ [CONS(first x,[CONS(first y,rest y) for y in rest x]) for x in CAAR $InteractiveFrame]
first $frameRecord
diffAlist(new,old) ==
@@ -2689,14 +2689,14 @@ diffAlist(new,old) ==
-- a) for each property with a value: give the old value
-- b) for each property missing: give NIL as the old value
oldPair := ASSQ(name,old) =>
- null (oldProplist := CDR oldPair) =>
+ null (oldProplist := rest oldPair) =>
--record old values of new properties as NIL
acc := [[name,:[[prop] for [prop,:.] in proplist]],:acc]
deltas := nil
for (propval := [prop,:val]) in proplist repeat
null (oldPropval := assoc(prop,oldProplist)) => --missing property
deltas := [[prop],:deltas]
- EQ(CDR oldPropval,val) => 'skip
+ EQ(rest oldPropval,val) => 'skip
deltas := [oldPropval,:deltas]
deltas => acc := [[name,:NREVERSE deltas],:acc]
acc := [[name,:[[prop] for [prop,:.] in proplist]],:acc]
@@ -2786,10 +2786,10 @@ undoSingleStep(changes,env) ==
if LASSOC('localModemap,changeList) then
changeList := undoLocalModemapHack changeList
pairlist := ASSQ(name,env) =>
- proplist := CDR pairlist =>
+ proplist := rest pairlist =>
for (pair := [prop,:value]) in changeList repeat
node := ASSQ(prop,proplist) => RPLACD(node,value)
- RPLACD(proplist,[CAR proplist,:CDR proplist])
+ RPLACD(proplist,[first proplist,:rest proplist])
RPLACA(proplist,pair)
RPLACD(pairlist,changeList)
env := [change,:env]
@@ -2884,7 +2884,7 @@ whatSpad2Cmd l ==
filterAndFormatConstructors(constrType,label,patterns) ==
centerAndHighlight(label,$LINELENGTH,specialChar 'hbar)
l := filterListOfStringsWithFn(patterns,whatConstructors constrType,
- function CDR)
+ function rest)
if patterns then
null l =>
sayMessage ['" No ",label,'" with names matching patterns:",
@@ -2917,7 +2917,7 @@ printSynonyms(patterns) ==
centerAndHighlight("System Command Synonyms",$LINELENGTH,specialChar 'hbar)
ls := filterListOfStringsWithFn(patterns, [[STRINGIMAGE a,:eval b]
for [a,:b] in synonymsForUserLevel $CommandSynonymAlist],
- function CAR)
+ function first)
printLabelledList(ls,'"user",'"synonyms",'")",patterns)
nil
@@ -2979,7 +2979,7 @@ filterListOfStrings(patterns,names) ==
filterListOfStringsWithFn(patterns,names,fn) ==
-- names and patterns are lists of strings
- -- fn is something like CAR or second
+ -- fn is something like first or second
-- returns: list of strings in names that contains any of the strings
-- in patterns
(null patterns) or (null names) => names
@@ -3260,8 +3260,8 @@ dumbTokenize str ==
nreverse tokenList
handleParsedSystemCommands(unabr, optionList) ==
- restOptionList := [dumbTokenize opt for opt in CDR optionList]
- parcmd := [parseSystemCmd CAR optionList,
+ restOptionList := [dumbTokenize opt for opt in rest optionList]
+ parcmd := [parseSystemCmd first optionList,
:[[tokTran tok for tok in opt] for opt in restOptionList]]
systemCommand parcmd
@@ -3301,7 +3301,7 @@ npProcessSynonym(str) ==
else
pair := processSynonymLine str
if $CommandSynonymAlist then
- PUTALIST($CommandSynonymAlist,CAR pair, CDR pair)
+ PUTALIST($CommandSynonymAlist,first pair, rest pair)
else $CommandSynonymAlist := [pair]
terminateSystemCommand()
diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot
index 0a9563b3..a71c617b 100644
--- a/src/interp/i-toplev.boot
+++ b/src/interp/i-toplev.boot
@@ -302,7 +302,7 @@ interpretTopLevel(x, posnForm) ==
c
interpret(x, :restargs) ==
- posnForm := if CONSP restargs then CAR restargs else restargs
+ posnForm := if CONSP restargs then first restargs else restargs
--type analyzes and evaluates expression x, returns object
$env:local := [[nil]]
$eval:local := true --generate code-- don't just type analyze
diff --git a/src/interp/i-util.boot b/src/interp/i-util.boot
index 1c125f9e..a48dbbe7 100644
--- a/src/interp/i-util.boot
+++ b/src/interp/i-util.boot
@@ -47,7 +47,7 @@ $intTopLevel ==
inputPrompt str ==
-- replaces older INPUT-PROMPT
atom (x := $SCREENSIZE()) => NIL
- p := CAR(x) - 2
+ p := first(x) - 2
y := $OLDLINE
SETQ($OLDLINE,NIL)
y => _$SHOWLINE(STRCONC(str,EBCDIC 19,y),p)
@@ -117,8 +117,8 @@ variableNumber(x) ==
null p =>
$variableNumberAlist := [[x,:0], :$variableNumberAlist]
0
- RPLACD(p, 1+CDR p)
- CDR p
+ RPLACD(p, 1+rest p)
+ rest p
newType? t == nil
@@ -129,13 +129,13 @@ Undef(:u) ==
u':= LAST u
[[domain,slot],op,sig]:= u'
domain':=eval mkEvalable domain
- not EQ(CAR ELT(domain',slot), function Undef) =>
+ not EQ(first ELT(domain',slot), function Undef) =>
-- OK - thefunction is now defined
[:u'',.]:=u
if $reportBottomUpFlag then
sayMessage concat ['" Retrospective determination of slot",'%b,
slot,'%d,'"of",'%b,:prefix2String domain,'%d]
- APPLY(CAR ELT(domain',slot),[:u'',CDR ELT(domain',slot)])
+ APPLY(first ELT(domain',slot),[:u'',rest ELT(domain',slot)])
throwKeyedMsg("S2IF0008",[formatOpSignature(op,sig),domain])
makeInitialModemapFrame() ==
diff --git a/src/interp/incl.boot b/src/interp/incl.boot
index 016a2fa5..c09ddcfe 100644
--- a/src/interp/incl.boot
+++ b/src/interp/incl.boot
@@ -78,7 +78,7 @@ incLine(eb, str, gno, lno, ufo) ==
ln := lnCreate(eb,str,gno,lno,ufo)
CONS(CONS(ln,1), str)
-incPos f == CAR f
+incPos f == first f
incRenumberItem(f, i) ==
l := CAAR f
@@ -174,7 +174,7 @@ incActive?(fn,ufos)==member(fn,ufos)
incNConsoles ufos==
a:=member('"console",ufos)
- if a then 1+incNConsoles CDR a else 0
+ if a then 1+incNConsoles rest a else 0
--% Message Handling
incHandleMessage(xl) ==
@@ -267,7 +267,7 @@ xlIfSyntax(eb, str, lno,ufos,info,sts) ==
incLude(eb, ss, ln, ufos, states) ==
Delay(function incLude1,[eb, ss, ln, ufos, states])
-Rest s==>incLude (eb,CDR ss,lno,ufos,states)
+Rest s==>incLude (eb,rest ss,lno,ufos,states)
incLude1 (:z) ==
[eb, ss, ln, ufos, states]:=z
@@ -281,7 +281,7 @@ incLude1 (:z) ==
'")--premature end", lno,ufos), StreamNil)
StreamNil
- str := EXPAND_-TABS CAR ss
+ str := EXPAND_-TABS first ss
info := incClassify str
not info.0 =>
@@ -350,7 +350,7 @@ incLude1 (:z) ==
Skipping? state => IfSkipToEnd
if ifCond(str,info) then IfKeepPart else IfSkipPart
cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,CDR ss,lno,ufos,cons(s1,states)))
+ incLude(eb,rest ss,lno,ufos,cons(s1,states)))
info.2 = '"elseif" =>
not If? state and not Elseif? state =>
cons(xlIfSyntax(eb, str,lno,ufos,info,states),
@@ -366,7 +366,7 @@ incLude1 (:z) ==
else ElseifSkipPart
else ElseifSkipToEnd
cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,CDR ss,lno,ufos,cons(s1,rest states)))
+ incLude(eb,rest ss,lno,ufos,cons(s1,rest states)))
else
cons(xlIfBug(eb, str, lno,ufos), StreamNil)
@@ -380,7 +380,7 @@ incLude1 (:z) ==
then ElseKeepPart
else ElseSkipToEnd
cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,CDR ss,lno,ufos,cons(s1,rest states)))
+ incLude(eb,rest ss,lno,ufos,cons(s1,rest states)))
else
cons(xlIfBug(eb, str, lno,ufos), StreamNil)
@@ -389,7 +389,7 @@ incLude1 (:z) ==
cons(xlIfSyntax(eb, str,lno,ufos,info,states),
StreamNil)
cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,CDR ss,lno,ufos,rest states))
+ incLude(eb,rest ss,lno,ufos,rest states))
info.2 = '"magicNumber" =>
Rest s
diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot
index 3b30ab03..2ac19f7e 100644
--- a/src/interp/int-top.boot
+++ b/src/interp/int-top.boot
@@ -179,21 +179,21 @@ intloopPrefix?(prefix,whole) ==
intloopProcess(n,interactive,s)==
StreamNull s => n
- [lines,ptree]:=CAR s
+ [lines,ptree]:=first s
pfAbSynOp?(ptree,"command")=>
if interactive then setCurrentLine tokPart ptree
FUNCALL($systemCommandFunction, tokPart ptree)
- intloopProcess(n ,interactive ,CDR s)
+ intloopProcess(n ,interactive ,rest s)
intloopProcess(intloopSpadProcess(n,lines,ptree,interactive)
- ,interactive ,CDR s)
+ ,interactive ,rest s)
intloopEchoParse s==
- [dq,stream]:=CAR s
+ [dq,stream]:=first s
[lines,rest]:=ncloopDQlines(dq,$lines)
setCurrentLine(mkLineList(lines))
if $EchoLines then ncloopPrintLines lines
$lines:=rest
- cons([[lines,npParse dqToList dq]],CDR s)
+ cons([[lines,npParse dqToList dq]],rest s)
intloopInclude0(st, name, n) ==
$lines:local:=incStream(st,name)
@@ -265,8 +265,8 @@ phIntReportMsgs(carrier, interactive?) ==
'OK
mkLineList lines ==
- l := [CDR line for line in lines | nonBlank CDR line]
- #l = 1 => CAR l
+ l := [rest line for line in lines | nonBlank rest line]
+ #l = 1 => first l
l
nonBlank str ==
@@ -309,12 +309,12 @@ streamChop(n,s)==
else
[a,b]:= streamChop(n-1,cdr s)
line:=car s
- c:=ncloopPrefix?('")command",CDR line)
+ c:=ncloopPrefix?('")command",rest line)
d:= cons(car line,if c then c else cdr line)
[cons(d,a),b]
ncloopPrintLines lines ==
- for line in lines repeat WRITE_-LINE CDR line
+ for line in lines repeat WRITE_-LINE rest line
WRITE_-LINE '" "
ncloopIncFileName string==
@@ -325,9 +325,9 @@ ncloopIncFileName string==
fn
ncloopParse s==
- [dq,stream]:=CAR s
+ [dq,stream]:=first s
[lines,rest]:=ncloopDQlines(dq,stream)
- cons([[lines,npParse dqToList dq]],CDR s)
+ cons([[lines,npParse dqToList dq]],rest s)
ncloopInclude0(st, name, n) ==
$lines:local := incStream(st, name)
@@ -419,8 +419,8 @@ phBegin id ==
if $ncmPhase then intSayKeyedMsg('S2CTP021,[id])
PullAndExecuteSpadSystemCommand stream ==
- ExecuteSpadSystemCommand CAR stream
- CDR stream
+ ExecuteSpadSystemCommand first stream
+ rest stream
ExecuteSpadSystemCommand string ==
FUNCALL($systemCommandFunction, string)
diff --git a/src/interp/interop.boot b/src/interp/interop.boot
index c242ed94..53b4001e 100644
--- a/src/interp/interop.boot
+++ b/src/interp/interop.boot
@@ -62,49 +62,49 @@ DNameOtherID := 3
DNameToSExpr1 dname ==
NULL dname => error "unexpected domain name"
- CAR dname = DNameStringID =>
- INTERN(CompStrToString CDR dname)
- name0 := DNameToSExpr1 CAR CDR dname
- args := CDR CDR dname
+ first dname = DNameStringID =>
+ INTERN(CompStrToString rest dname)
+ name0 := DNameToSExpr1 first rest dname
+ args := rest rest dname
name0 = '_-_> =>
- froms := CAR args
- froms := MAPCAR(function DNameToSExpr, CDR froms)
- ret := CAR CDR args -- a tuple
- ret := DNameToSExpr CAR CDR ret -- contents
+ froms := first args
+ froms := MAPCAR(function DNameToSExpr, rest froms)
+ ret := first rest args -- a tuple
+ ret := DNameToSExpr first rest ret -- contents
CONS('Mapping, CONS(ret, froms))
name0 = 'Union or name0 = 'Record =>
- sxs := MAPCAR(function DNameToSExpr, CDR CAR args)
+ sxs := MAPCAR(function DNameToSExpr, rest first args)
CONS(name0, sxs)
name0 = 'Enumeration =>
- CONS(name0, MAPCAR(function DNameFixEnum, CDR CAR args))
+ CONS(name0, MAPCAR(function DNameFixEnum, rest first args))
CONS(name0, MAPCAR(function DNameToSExpr, args))
DNameToSExpr dname ==
- CAR dname = DNameOtherID =>
- CDR dname
+ first dname = DNameOtherID =>
+ rest dname
sx := DNameToSExpr1 dname
CONSP sx => sx
LIST sx
-DNameFixEnum arg == CompStrToString CDR arg
+DNameFixEnum arg == CompStrToString rest arg
SExprToDName(sexpr, cosigVal) ==
-- is it a non-type valued object?
NOT cosigVal => [DNameOtherID, :sexpr]
- if CAR sexpr = '_: then sexpr := CAR CDR CDR sexpr
- CAR sexpr = 'Mapping =>
- args := [ SExprToDName(sx,true) for sx in CDR sexpr]
+ if first sexpr = '_: then sexpr := first rest rest sexpr
+ first sexpr = 'Mapping =>
+ args := [ SExprToDName(sx,true) for sx in rest sexpr]
[DNameApplyID,
[DNameStringID,: StringToCompStr '"->"],
- [DNameTupleID, : CDR args],
- [DNameTupleID, CAR args]]
- name0 := [DNameStringID, : StringToCompStr SYMBOL_-NAME CAR sexpr]
- CAR sexpr = 'Union or CAR sexpr = 'Record =>
+ [DNameTupleID, : rest args],
+ [DNameTupleID, first args]]
+ name0 := [DNameStringID, : StringToCompStr SYMBOL_-NAME first sexpr]
+ first sexpr = 'Union or first sexpr = 'Record =>
[DNameApplyID, name0,
- [DNameTupleID,: [ SExprToDName(sx,true) for sx in CDR sexpr]]]
+ [DNameTupleID,: [ SExprToDName(sx,true) for sx in rest sexpr]]]
newCosig := rest getDualSignatureFromDB first sexpr
[DNameApplyID, name0,
- : MAPCAR(function SExprToDName, CDR sexpr, newCosig)]
+ : MAPCAR(function SExprToDName, rest sexpr, newCosig)]
-- local garbage because Compiler strings are null terminated
StringToCompStr(str) ==
@@ -139,13 +139,13 @@ closeOldAxiomFunctor(name) ==
lazyOldAxiomDomainLookupExport(domenv, self, op, sig, box, skipdefaults, env) ==
dom := instantiate domenv
- SPADCALL(CDR dom, self, op, sig, box, skipdefaults, CAR(dom).3)
+ SPADCALL(rest dom, self, op, sig, box, skipdefaults, first(dom).3)
-lazyOldAxiomDomainHashCode(domenv, env) == CAR domenv
+lazyOldAxiomDomainHashCode(domenv, env) == first domenv
lazyOldAxiomDomainDevaluate(domenv, env) ==
dom := instantiate domenv
- SPADCALL(CDR dom, CAR(dom).1)
+ SPADCALL(rest dom, first(dom).1)
lazyOldAxiomAddChild(domenv, kid, env) ==
CONS($lazyOldAxiomDomainDispatch,domenv)
@@ -195,7 +195,7 @@ oldAxiomPreCategoryParents(catform,dom) ==
quoteCatOp cat ==
atom cat => MKQ cat
- ['LIST, MKQ CAR cat,: CDR cat]
+ ['LIST, MKQ first cat,: rest cat]
oldAxiomCategoryLookupExport(catenv, self, op, sig, box, env) ==
@@ -273,7 +273,7 @@ orderedDefaults(conform,domform) ==
instantiate domenv ==
-- following is a patch for a bug in runtime.as
-- has a lazy dispatch vector with an instantiated domenv
- VECTORP CDR domenv => [$oldAxiomDomainDispatch ,: domenv]
+ VECTORP rest domenv => [$oldAxiomDomainDispatch ,: domenv]
callForm := second domenv
oldDom := CDDR domenv
[functor,:args] := callForm
@@ -301,7 +301,7 @@ $hashPercent := hashString '"%"
oldAxiomDomainLookupExport _
(domenv, self, op, sig, box, skipdefaults, env) ==
- domainVec := CDR domenv
+ domainVec := rest domenv
if hashCode? op then
EQL(op, $hashOp1) => op := 'One
EQL(op, $hashOp0) => op := 'Zero
@@ -321,14 +321,14 @@ oldAxiomDomainLookupExport _
RPLACA(box, val)
box
-oldAxiomDomainHashCode(domenv, env) == CAR domenv
+oldAxiomDomainHashCode(domenv, env) == first domenv
oldAxiomDomainHasCategory(domenv, cat, env) ==
- HasAttribute(domvec := CDR domenv, cat) or
+ HasAttribute(domvec := rest domenv, cat) or
HasCategory(domvec, devaluate cat)
oldAxiomDomainDevaluate(domenv, env) ==
- SExprToDName(CDR(domenv).0, 'T)
+ SExprToDName(rest(domenv).0, 'T)
oldAxiomAddChild(domenv, child, env) == CONS($oldAxiomDomainDispatch, domenv)
@@ -342,7 +342,7 @@ $oldAxiomDomainDispatch :=
basicLookupCheckDefaults(op,sig,domain,dollar) ==
box := [nil]
- not VECP(dispatch := CAR dollar) => error "bad domain format"
+ not VECP(dispatch := first dollar) => error "bad domain format"
lookupFun := dispatch.3
dispatch.0 = 0 => -- new compiler domain object
hashPercent :=
@@ -354,8 +354,8 @@ basicLookupCheckDefaults(op,sig,domain,dollar) ==
hashType( ['Mapping,:sig], hashPercent)
if SYMBOLP op then op := hashString SYMBOL_-NAME op
- CAR SPADCALL(CDR dollar, dollar, op, hashSig, box, not $lookupDefaults, lookupFun)
- CAR SPADCALL(CDR dollar, dollar, op, sig, box, not $lookupDefaults, lookupFun)
+ first SPADCALL(rest dollar, dollar, op, hashSig, box, not $lookupDefaults, lookupFun)
+ first SPADCALL(rest dollar, dollar, op, sig, box, not $lookupDefaults, lookupFun)
$hasCatOpHash := hashString '"%%"
opIsHasCat op ==
@@ -502,7 +502,7 @@ hashNewLookupInCategories(op,sig,dom,dollar) ==
--not nrunNumArgCheck(#(QCDR sig),byteVector,opvec.code,endPos) => nil
--numOfArgs := byteVector.(opvec.code)
--numOfArgs ~= #(QCDR sig) => nil
- packageForm := [entry,'$,:CDR cat]
+ packageForm := [entry,'$,:rest cat]
package := evalSlotDomain(packageForm,dom)
packageVec.i := package
package
@@ -510,7 +510,7 @@ hashNewLookupInCategories(op,sig,dom,dollar) ==
table := HGET($Slot1DataBase,entry) or systemError nil
(u := LASSQ(op,table))
and (v := or/[rest x for x in u]) =>
- packageForm := [entry,'$,:CDR cat]
+ packageForm := [entry,'$,:rest cat]
package := evalSlotDomain(packageForm,dom)
packageVec.i := package
package
@@ -571,7 +571,7 @@ newHasCategory(domain,catform) ==
catform is ["Join",:cats] =>
and/[newHasCategory(domain,cat) for cat in cats]
slot4 := domain.4
- auxvec := CAR slot4
+ auxvec := first slot4
catvec := second slot4
$isDefaultingPackage: local := isDefaultPackageForm? devaluate domain
#catvec > 0 and INTEGERP KDR catvec.0 => --old style
diff --git a/src/interp/intfile.boot b/src/interp/intfile.boot
index 5c3790e6..31af759b 100644
--- a/src/interp/intfile.boot
+++ b/src/interp/intfile.boot
@@ -43,17 +43,17 @@ shoeInternFile(fn)==
shoeIntern (s)==
StreamNull s => nil
- f:=CAR s
- # f < 8 => shoeIntern CDR s
- f.0=char " " =>shoeIntern CDR s
+ f:=first s
+ # f < 8 => shoeIntern rest s
+ f.0=char " " =>shoeIntern rest s
a:=INTERN SUBSTRING (f,0,8)
- [b,c]:= shoeStrings CDR s
+ [b,c]:= shoeStrings rest s
SETF(GET (a,"MSGS"),b)
shoeIntern c
shoeStrings (stream)==
StreamNull stream => ['"",stream]
- a:=CAR stream
+ a:=first stream
if a.0 ~= char " "
then ['"",stream]
else
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index d240b632..86512de3 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -170,7 +170,7 @@ loadLib cname ==
coSig :=
u =>
[[.,:sig],:.] := u
- CONS(NIL,[categoryForm?(x) for x in CDR sig])
+ CONS(NIL,[categoryForm?(x) for x in rest sig])
NIL
-- in following, add property value false or NIL to possibly clear
-- old value
@@ -293,7 +293,7 @@ compileConstructorLib(l,op,editFlag,traceFlag) ==
'_? in l => return editFile '(_/C TELL _*)
optionList:= _/OPTIONS l
funList:= TRUNCLIST(l,optionList) or [_/FN]
- options:= [[UPCASE CAR x,:CDR x] for x in optionList]
+ options:= [[UPCASE first x,:rest x] for x in optionList]
infile:= _/MKINFILENAM _/GETOPTION(options,'FROM_=)
outfile:= _/MKINFILENAM _/GETOPTION(options,'TO_=)
res:= [compConLib1(fn,infile,outfile,op,editFlag,traceFlag)
@@ -321,7 +321,7 @@ compConLib1(fun,infileOrNil,outfileOrNil,auxOp,editFlag,traceFlag) ==
$libFile: local := NIL
$lisplibVariableAlist: local := NIL
$lisplibSignatureAlist: local := NIL
- if null atom fun and null CDR fun then fun:= CAR fun -- unwrap nullary
+ if null atom fun and null rest fun then fun:= first fun -- unwrap nullary
libName:= getConstructorAbbreviation fun
infile:= infileOrNil or getFunctionSourceFile fun or
throwKeyedMsg("S2IL0004",[fun])
@@ -434,14 +434,14 @@ finalizeLisplib libName ==
lisplibWrite('"modemaps",removeZeroOne $lisplibModemapAlist,$libFile)
opsAndAtts:= getConstructorOpsAndAtts(
$lisplibForm,kind,$lisplibModemap)
- lisplibWrite('"operationAlist",removeZeroOne CAR opsAndAtts,$libFile)
- --lisplibWrite('"attributes",CDR opsAndAtts,$libFile)
- --if kind='category then NRTgenInitialAttributeAlist CDR opsAndAtts
+ lisplibWrite('"operationAlist",removeZeroOne first opsAndAtts,$libFile)
+ --lisplibWrite('"attributes",rest opsAndAtts,$libFile)
+ --if kind='category then NRTgenInitialAttributeAlist rest opsAndAtts
if kind='category then
$pairlis : local := [[a,:v] for a in rest $lisplibForm
for v in $FormalMapVariableList]
$NRTslot1PredicateList : local := []
- NRTgenInitialAttributeAlist CDR opsAndAtts
+ NRTgenInitialAttributeAlist rest opsAndAtts
lisplibWrite('"superDomain",removeZeroOne $lisplibSuperDomain,$libFile)
lisplibWrite('"signaturesAndLocals",
removeZeroOne mergeSignatureAndLocalVarAlists($lisplibSignatureAlist,
@@ -454,8 +454,8 @@ finalizeLisplib libName ==
lisplibWrite('"documentation",finalizeDocumentation(),$libFile)
lisplibWrite('"slot1Info",removeZeroOne $lisplibSlot1,$libFile)
if $profileCompiler then profileWrite()
- if $lisplibForm and null CDR $lisplibForm then
- MAKEPROP(CAR $lisplibForm,'NILADIC,'T)
+ if $lisplibForm and null rest $lisplibForm then
+ MAKEPROP(first $lisplibForm,'NILADIC,'T)
leaveIfErrors libName
true
@@ -495,7 +495,7 @@ getConstructorOpsAndAtts(form,kind,modemap) ==
getFunctorOpsAndAtts(form,modemap)
getCategoryOpsAndAtts(catForm) ==
- -- returns [operations,:attributes] of CAR catForm
+ -- returns [operations,:attributes] of first catForm
[transformOperationAlist getSlotFromCategoryForm(catForm,1),
:getSlotFromCategoryForm(catForm,2)]
@@ -582,8 +582,8 @@ bustUnion d ==
d
getSlotNumberFromOperationAlist(domainForm,op,sig) ==
- constructorName:= CAR domainForm
- constructorArglist:= CDR domainForm
+ constructorName:= first domainForm
+ constructorArglist:= rest domainForm
operationAlist:=
getConstructorOperationsFromDB constructorName or
keyedSystemError("S2IL0026",[constructorName])
@@ -597,7 +597,7 @@ sigsMatch(sig,sig1,domainForm) ==
-- sig1 designate corresponding arguments of domainForm
while sig and sig1 repeat
partsMatch:=
- (item:= CAR sig)=(item1:= CAR sig1) => true --ok, go to next iteration
+ (item:= first sig)=(item1:= first sig1) => true --ok, go to next iteration
FIXP item1 => item = domainForm.item1 --item1=n means nth arg
isSubset(bustUnion item1,bustUnion item,$CategoryFrame)
null partsMatch => return nil
diff --git a/src/interp/macex.boot b/src/interp/macex.boot
index b1c87eee..f426239f 100644
--- a/src/interp/macex.boot
+++ b/src/interp/macex.boot
@@ -88,7 +88,7 @@ macLambdaParameterHandling( replist , pform ) ==
macSubstituteId( replist , pform ) ==
ex := AlistAssocQ( pfIdSymbol pform , replist )
ex =>
- RPLPAIR(pform,CDR ex)
+ RPLPAIR(pform,rest ex)
pform
pform
diff --git a/src/interp/mark.boot b/src/interp/mark.boot
index 66e18a09..ef5bdb64 100644
--- a/src/interp/mark.boot
+++ b/src/interp/mark.boot
@@ -82,12 +82,12 @@ tcheck T ==
markComp(x,T) == --for comp
tcheck T
- x ~= CAR T => [mkWi('comp,'WI,x,CAR T),:CDR T]
+ x ~= first T => [mkWi('comp,'WI,x,first T),:rest T]
T
markAny(key,x,T) ==
tcheck T
- x ~= CAR T => [mkWi(key,'WI,x,CAR T),:CDR T]
+ x ~= first T => [mkWi(key,'WI,x,first T),:rest T]
T
markConstruct(x,T) ==
@@ -96,7 +96,7 @@ markConstruct(x,T) ==
markParts(x,T) == --x is ['PART,n,y] --for compNoStacking
tcheck T
- [mkWi('makeParts,'WI,x,CAR T),:CDR T]
+ [mkWi('makeParts,'WI,x,first T),:rest T]
yumyum kind == kind
markCoerce(T,T',kind) == --for coerce
@@ -110,7 +110,7 @@ markCoerce(T,T',kind) == --for coerce
$partExpression is [.,.,y] and T.expr = y => ['WI,y,$partExpression]
T.expr
res := [markCoerceChk mkWi('coerce,kind,T.mode,T'.mode,
- mkWi('coerce,'WI,u,T'.expr)),:CDR T']
+ mkWi('coerce,'WI,u,T'.expr)),:rest T']
res
markCoerceChk x ==
@@ -121,38 +121,38 @@ markMultipleExplicit(nameList, valList, T) ==
tcheck T
[mkWi('setqMultipleExplicit, 'WI,
["%LET", ["%Comma",:nameList], ["%Comma",:valList]],
- T.expr), :CDR T]
+ T.expr), :rest T]
markRetract(x,T) ==
tcheck T
- [mkWi('smallIntegerStep,'RETRACT,nil,['REPLACE,['retract,x]],T.expr),:CDR T]
+ [mkWi('smallIntegerStep,'RETRACT,nil,['REPLACE,['retract,x]],T.expr),:rest T]
markSimpleReduce(x,T) ==
tcheck T
- [mkWi('compreduce,'LAMBDA, nil, ["REPLACE",x], T.expr), :CDR T]
+ [mkWi('compreduce,'LAMBDA, nil, ["REPLACE",x], T.expr), :rest T]
markCompAtom(x,T) == --for compAtom
tcheck T
$convert2NewCompiler =>
- [mkWi('compAtom,'ATOM,nil,['REPLACE,[x]],T.expr),:CDR T]
+ [mkWi('compAtom,'ATOM,nil,['REPLACE,[x]],T.expr),:rest T]
T
markCase(x, tag, T) ==
tcheck T
[mkWi('compCase1, 'LAMBDA, nil, ["REPLACE",["case",x,tag]], T.expr),
- :CDR T]
+ :rest T]
markCaseWas(x,T) ==
tcheck T
- [mkWi('compCase1,'WI,x,T.expr),:CDR T]
+ [mkWi('compCase1,'WI,x,T.expr),:rest T]
markAutoWas(x,T) ==
tcheck T
- [mkWi('autoCoerce,'WI,x,T.expr),:CDR T]
+ [mkWi('autoCoerce,'WI,x,T.expr),:rest T]
markCallCoerce(x,m,T) ==
tcheck T
- [mkWi("call",'WI,["::",x,m], T.expr),: CDR T]
+ [mkWi("call",'WI,["::",x,m], T.expr),: rest T]
markCoerceByModemap(x,source,target,T, killColonColon?) ==
tcheck T
@@ -161,13 +161,13 @@ markCoerceByModemap(x,source,target,T, killColonColon?) ==
markAutoCoerceDown(x, tag, markAutoWas(x,T), killColonColon?)
target is ["Union",:l] and member(source,l) =>
markAutoCoerceUp(x,markAutoWas(x, T))
- [mkWi('markCoerceByModemap,'WI,x,T.expr),:CDR T]
+ [mkWi('markCoerceByModemap,'WI,x,T.expr),:rest T]
markAutoCoerceDown(x,tag,T,killColonColon?) ==
tcheck T
patch := ["dot",getSourceWI x,tag]
if killColonColon? then patch := ["REPLACE",["UNCOERCE",patch]]
- [mkWi('coerceExtraHard,'LAMBDA, nil,patch,T.expr), :CDR T]
+ [mkWi('coerceExtraHard,'LAMBDA, nil,patch,T.expr), :rest T]
markAutoCoerceUp(x,T) ==
-- y := getSourceWI x
@@ -177,11 +177,11 @@ markAutoCoerceUp(x,T) ==
tcheck T
[mkWi('coerceExtraHard,'LAMBDA, nil,["REPLACE",['construct, "##1"]],T.expr),
-----want to capture by ##1 what is there ------11/2/94
- :CDR T]
+ :rest T]
markCompSymbol(x,T) == --for compSymbol
tcheck T
- [mkWi('compSymbol,'ATOM,nil,['REPLACE,["@",x,$Symbol]],T.expr),:CDR T]
+ [mkWi('compSymbol,'ATOM,nil,['REPLACE,["@",x,$Symbol]],T.expr),:rest T]
markStepSI(ostep,nstep) == --for compIterator
['STEP,:r] := ostep
@@ -197,22 +197,22 @@ markStep(i) == mkWi('markStep,'FREE,nil,['REPLACE, ['PAREN,['free,i]]],i)
markPretend(T,T') ==
tcheck T
tcheck T'
- [mkWi('pretend,'COLON,"pretend",T.mode,T.expr),:CDR T']
+ [mkWi('pretend,'COLON,"pretend",T.mode,T.expr),:rest T']
markAt(T) ==
tcheck T
- [mkWi('compAtom,'COLON,"@",T.mode,T.expr),:CDR T]
+ [mkWi('compAtom,'COLON,"@",T.mode,T.expr),:rest T]
markCompColonInside(op,T) == --for compColonInside
tcheck T
$convert2NewCompiler =>
- [mkWi('compColonInside,'COLON,op,T.mode,T.expr),:CDR T]
+ [mkWi('compColonInside,'COLON,op,T.mode,T.expr),:rest T]
T
markLisp(T,m) == --for compForm1
tcheck T
$convert2NewCompiler =>
- [mkWi('compForm1,'COLON,'Lisp,T.mode,T.expr),:CDR T]
+ [mkWi('compForm1,'COLON,'Lisp,T.mode,T.expr),:rest T]
T
markLambda(vl,body,mode,T) == --for compWithMappingMode
@@ -221,7 +221,7 @@ markLambda(vl,body,mode,T) == --for compWithMappingMode
args := [[":",$PerCentVariableList.i,t] for i in 0.. for t in rest ml]
left := [":",['PAREN,:args],first ml]
fun := ['_+_-_>,left,SUBLISLIS($PerCentVariableList,vl,body)]
- [mkWi('compWithMappingMode,'LAMBDA,nil,['REPLACE,fun],T.expr),:CDR T]
+ [mkWi('compWithMappingMode,'LAMBDA,nil,['REPLACE,fun],T.expr),:rest T]
markMacro(before,after) == --for compMacro
$convert2NewCompiler =>
@@ -246,21 +246,21 @@ markReduceStep(it, pr) == markReduceIterator("step", it, pr)
markReduceWhile(it, pr) == markReduceIterator("while", it, pr)
markReduceUntil(it, pr) == markReduceIterator("until", it, pr)
markReduceSuchthat(it, pr) == markReduceIterator("suchthat", it, pr)
-markReduceIterator(kind, it, pr) == [mkWi(kind, 'WI, it, CAR pr), :CDR pr]
+markReduceIterator(kind, it, pr) == [mkWi(kind, 'WI, it, first pr), :rest pr]
markReduceBody(body,T) ==
tcheck T
- [mkWi("reduceBody",'WI,body,CAR T), :CDR T]
+ [mkWi("reduceBody",'WI,body,first T), :rest T]
markReduce(form, T) ==
tcheck T
- [SETQ($funk,mkWi("reduce", 'WI,form,CAR T)), :CDR T]
+ [SETQ($funk,mkWi("reduce", 'WI,form,first T)), :rest T]
markRepeatBody(body,T) ==
tcheck T
- [mkWi("repeatBody",'WI,body,CAR T), :CDR T]
+ [mkWi("repeatBody",'WI,body,first T), :rest T]
markRepeat(form, T) ==
tcheck T
- [mkWi("repeat", 'WI,form,CAR T), :CDR T]
+ [mkWi("repeat", 'WI,form,first T), :rest T]
markTran(form,form',[dc,:sig],env) == --from compElt/compFormWithModemap
dc ~= 'Rep or not ('_$ in sig) => mkWi('markTran,'WI,form,['call,:form'])
@@ -270,9 +270,9 @@ markTran(form,form',[dc,:sig],env) == --from compElt/compFormWithModemap
IDENTP argSource and getmode(argSource,env) = 'Rep => arg
markRepper('rep,arg)
arg
- form' := ['call,CAR form',:argl]
+ form' := ['call,first form',:argl]
wi := mkWi('markTran,'WI,form,form')
- CAR sig = '_$ => markRepper('per,wi)
+ first sig = '_$ => markRepper('per,wi)
wi
markRepper(key,form) == ['REPPER,nil,key,form]
@@ -324,8 +324,8 @@ markSetq(originalLet,T) == --for compSetq
$importStack := [nil,:$importStack]
$freeStack := [nil,:$freeStack]
capsuleStack('"Setq", entry)
--- [markKillMI T.expr,:CDR T]
- [code,:CDR T]
+-- [markKillMI T.expr,:rest T]
+ [code,:rest T]
if MEMQ(id,$domainLevelVariableList) then
$markFreeStack := insert(id,$markFreeStack)
T
@@ -342,7 +342,7 @@ markCapsuleExpression(originalExpr, T) ==
$importStack := [nil,:$importStack]
$freeStack := [nil,:$freeStack]
capsuleStack('"capsuleExpression", entry)
- [code,:CDR T]
+ [code,:rest T]
markLhs x ==
x is [":",a,.] => a
@@ -506,8 +506,8 @@ markEncodeChanges(x,s) ==
x is ['TAGGEDreturn,a,[y,:.]] => markEncodeChanges(y,s)
x is ['CATCH,a,y] => markEncodeChanges(y,s)
atom x => nil
--- CAR x = IFCAR IFCAR s =>
--- for y in x for r in CAR s repeat markEncodeChanges(y,[r,:s])
+-- first x = IFCAR IFCAR s =>
+-- for y in x for r in first s repeat markEncodeChanges(y,[r,:s])
for y in x repeat markEncodeChanges(y,s)
markOrigName x ==
@@ -619,14 +619,14 @@ markPath1 u ==
-- The result is the successful path from a to c
-- A error printout occurs if no such path can be found
u is [a,b,:r] => -- a < b < ...
- a = b => markPath1 CDR u ---> allow duplicates on path
+ a = b => markPath1 rest u ---> allow duplicates on path
path := markGetPath(a,b) or return nil -----> early exit
if $shout1 then
pp '"========="
pp path
pp a
pp b
- [:first path,:markPath1 CDR u]
+ [:first path,:markPath1 rest u]
nil
$pathErrorStack := nil
@@ -761,7 +761,7 @@ markInsertChanges(code,form,t,loc) ==
loc is [i,:r] =>
x := form
for j in 0..(i-1) repeat
- if not atom x then x := CDR x
+ if not atom x then x := rest x
atom x =>
pp '"Translator RPLACA error"
pp $data
@@ -770,7 +770,7 @@ markInsertChanges(code,form,t,loc) ==
if $hohum then pp [i, '" >>> ", x]
SETQ($CHANGE,COPY x)
if x is ['elt,:y] and r then x := y
- RPLACA(x,markInsertChanges(code,CAR x,t,rest loc))
+ RPLACA(x,markInsertChanges(code,first x,t,rest loc))
chk(x,100)
form
-- pp ['"Making change: ",code,form,t]
@@ -930,11 +930,11 @@ markPrintAttributes addForm ==
capsule :=
addForm is ['add,a,:.] =>
a is ['CATEGORY,:.] => a
- a is ['Join,:.] => CAR LASTNODE a
- CAR LASTNODE addForm
+ a is ['Join,:.] => first LASTNODE a
+ first LASTNODE addForm
addForm
if capsule is ['CAPSULE,:r] then
- capsule := CAR LASTNODE r
+ capsule := first LASTNODE r
capsule isnt ['CATEGORY,.,:lst] => nil
for x in lst | x is ['ATTRIBUTE,att] repeat
markSay(form2String att)
@@ -1306,14 +1306,14 @@ moveLinesAfter(alist, lines) ==
n := #lines
acc := nil
for i in 0..(n - 1) for x in lines repeat
- (p := ASSOC(i, alist)) and STRINGP CDR p => acc := [CDR p, x, :acc]
- (p := lookupRight(i, alist)) and (CAR p) > i => RPLACD(p, x)
+ (p := ASSOC(i, alist)) and STRINGP rest p => acc := [rest p, x, :acc]
+ (p := lookupRight(i, alist)) and (first p) > i => RPLACD(p, x)
acc := [x, :acc]
REVERSE acc
lookupRight(x, al) ==
al is [p, :al] =>
- x = CDR p => p
+ x = rest p => p
lookupRight(x, al)
nil
@@ -1429,7 +1429,7 @@ combineDefinitions() ==
item := [predl, :defs]
op := opOf form
oldAlist := HGET($hash,opOf form)
- pair := ASSOC(sig, oldAlist) => RPLACD(pair, [item,:CDR pair])
+ pair := ASSOC(sig, oldAlist) => RPLACD(pair, [item,:rest pair])
HPUT($hash, op, [[sig, item], :oldAlist])
--extract and combine multiple definitions
Xdeflist := nil
@@ -1465,8 +1465,8 @@ buildNewDefinition(op,theSig,formPredAlist) ==
outerPred := boolBin simpHasPred MKPF(ASSOCLEFT newAlist,"or")
theForm := CDAR newAlist
alist := moveTruePred2End newAlist
- theArgl := CDR theForm
- theAlist := [[pred, CAR form, :theArgl] for [pred,:form] in alist]
+ theArgl := rest theForm
+ theAlist := [[pred, first form, :theArgl] for [pred,:form] in alist]
theNils := [nil for x in theForm]
thePred :=
member(outerPred, '(T (QUOTE T))) => nil
diff --git a/src/interp/modemap.boot b/src/interp/modemap.boot
index 1207dac1..8f7e1c27 100644
--- a/src/interp/modemap.boot
+++ b/src/interp/modemap.boot
@@ -279,7 +279,7 @@ AMFCR_,redefined(opname,u) ==
not(u is [op,:l]) => nil
op = 'DEF => opname = CAAR l
op in '(PROGN SEQ) => AMFCR_,redefinedList(opname,l)
- op = 'COND => "OR"/[AMFCR_,redefinedList(opname,CDR u) for u in l]
+ op = 'COND => "OR"/[AMFCR_,redefinedList(opname,rest u) for u in l]
augModemapsFromCategory(domainName,domainView,functorForm,categoryForm,e) ==
[fnAlist,e]:= evalAndSub(domainName,domainView,functorForm,categoryForm,e)
@@ -296,7 +296,7 @@ augModemapsFromCategory(domainName,domainView,functorForm,categoryForm,e) ==
---------conditions attached to each modemap being added, takes a very long time
---------instead conditions will be checked when maps are actually used
--v:=ASSOC(cond,condlist) =>
- -- e:= addModemapKnown(op,domainName,sig,CDR v,fnsel,e)
+ -- e:= addModemapKnown(op,domainName,sig,rest v,fnsel,e)
--$e:local := e -- $e is used by knownInfo
--if knownInfo cond then cond1:=true else cond1:=cond
--condlist:=[[cond,:cond1],:condlist]
diff --git a/src/interp/msg.boot b/src/interp/msg.boot
index 6894bdf7..667262d6 100644
--- a/src/interp/msg.boot
+++ b/src/interp/msg.boot
@@ -104,7 +104,7 @@ ncBug (erMsgKey, erArgL,:optAttr) ==
msgCreate(tag,posWTag,key,argL,optPre,:optAttr) ==
if CONSP key then tag := 'old
msg := [tag,posWTag,key,argL,optPre,NIL]
- if CAR optAttr then
+ if first optAttr then
setMsgForcedAttrList(msg,car optAttr)
putDatabaseStuff msg
initImPr msg
@@ -145,8 +145,8 @@ getMsgInfoFromKey msg ==
getErFromDbL (erMsgKey,dbL) ==
erMsg := NIL
while null erMsg repeat
- dbName := CAR dbL
- dbL := CDR dbL
+ dbName := first dbL
+ dbL := rest dbL
$msgDatabaseName := dbName
lastName := null dbL
-- fileFound := '"co_-eng.msgs"
@@ -197,16 +197,16 @@ insertPos(newPos,posList) ==
bot := [0,:posList]
top := []
while not done repeat
- top := [CAR bot,:top]
- bot := CDR bot
- pos := CAR bot
+ top := [first bot,:top]
+ bot := rest bot
+ pos := first bot
done :=
pos < newPos => false
pos = newPos => true
pos > newPos =>
top := [newPos,:top]
true
- [CDR reverse top,:bot]
+ [rest reverse top,:bot]
putFTText (msg,chPosList) ==
tag := getMsgFTTag? msg
@@ -272,8 +272,8 @@ erMsgSep erMsgList ==
msgWPos := [msg,:msgWPos]
[msgWPos,msgWOPos]
-getLinePos line == CAR line
-getLineText line == CDR line
+getLinePos line == first line
+getLineText line == rest line
queueUpErrors(globalNumOfLine,msgList)==
thisPosMsgs := []
@@ -436,14 +436,14 @@ getPreStL optPre ==
desiredMsg (erMsgKey,:optCatFlag) ==
isKeyQualityP(erMsgKey,'show) => true
isKeyQualityP(erMsgKey,'stifle) => false
- not null optCatFlag => CAR optCatFlag
+ not null optCatFlag => first optCatFlag
true
isKeyQualityP (key,qual) ==
--returns pair if found, else NIL
found := false
while not found and (qualPair := assoc(key,$specificMsgTags)) repeat
- if CDR qualPair = qual then found := true
+ if rest qualPair = qual then found := true
qualPair
-----------------------------
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index 0f62de70..064d1bd3 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -207,7 +207,7 @@ substituteSegmentedMsg(msg,args) ==
--end of the list. (using %n and %y)
l :=
CONSP(arg) =>
- MEMQ(char 'y,q) or (CAR arg = '"%y") or ((LENGTH arg) = 1) =>
+ MEMQ(char 'y,q) or (first arg = '"%y") or ((LENGTH arg) = 1) =>
APPEND(REVERSE arg, l)
head := first arg
tail := rest arg
@@ -259,7 +259,7 @@ noBlankBeforeP word==
if CVECP word and SIZE word > 1 then
word.0 = char '% and word.1 = char 'x => return true
word.0 = char " " => return true
- (CONSP word) and member(CAR word,$msgdbListPrims) => true
+ (CONSP word) and member(first word,$msgdbListPrims) => true
false
$msgdbNoBlanksAfterGroup == ['" ", " ",'"%" ,"%", :$msgdbPrims,
@@ -271,7 +271,7 @@ noBlankAfterP word==
if CVECP word and (s := SIZE word) > 1 then
word.0 = char '% and word.1 = char 'x => return true
word.(s-1) = char " " => return true
- (CONSP word) and member(CAR word, $msgdbListPrims) => true
+ (CONSP word) and member(first word, $msgdbListPrims) => true
false
cleanUpSegmentedMsg msg ==
@@ -286,7 +286,7 @@ cleanUpSegmentedMsg msg ==
msg1 := NIL
for x in msg repeat
if haveBlank and (member(x,blanks) or member(x,prims)) then
- msg1 := CDR msg1
+ msg1 := rest msg1
msg1 := cons(x,msg1)
haveBlank := (member(x,blanks) => true; NIL)
msg1
@@ -456,7 +456,7 @@ sayKeyedMsgFromDb(key,args,dbName) ==
returnStLFromKey(key,argL,:optDbN) ==
savedDbN := $msgDatabaseName
if IFCAR optDbN then
- $msgDatabaseName := pathname CAR optDbN
+ $msgDatabaseName := pathname first optDbN
text := fetchKeyedMsg(key, false)
$msgDatabaseName := savedDbN
text := segmentKeyedMsg text
@@ -507,15 +507,15 @@ flowSegmentedMsg(msg, len, offset) ==
actualMarg := potentialMarg
if lnl = 99999 then nl := ['%l,:nl]
lnl := 99999
- CONSP(f) and member(CAR(f),'("%m" %m '%ce "%ce" %rj "%rj")) =>
+ CONSP(f) and member(first(f),'("%m" %m '%ce "%ce" %rj "%rj")) =>
actualMarg := potentialMarg
nl := [f,'%l,:nl]
lnl := 199999
member(f,'("%i" %i )) =>
potentialMarg := potentialMarg + 3
nl := [f,:nl]
- CONSP(f) and member(CAR(f),'("%t" %t)) =>
- potentialMarg := potentialMarg + CDR f
+ CONSP(f) and member(first(f),'("%t" %t)) =>
+ potentialMarg := potentialMarg + rest f
nl := [f,:nl]
sbl := sayBrightlyLength f
tot := lnl + offset + sbl + actualMarg
@@ -571,7 +571,7 @@ throwKeyedMsgCannotCoerceWithValue(val,t1,t2) ==
--% Some Standard Message Printing Functions
-bright x == ['"%b",:(CONSP(x) and NULL CDR LASTNODE x => x; [x]),'"%d"]
+bright x == ['"%b",:(CONSP(x) and NULL rest LASTNODE x => x; [x]),'"%d"]
--bright x == ['%b,:(ATOM x => [x]; x),'%d]
mkMessage msg ==
@@ -717,7 +717,7 @@ brightPrintHighlight(x, out == $OutputStream) ==
sayString('"(",out)
brightPrint1(key,out)
if EQ(key,'TAGGEDreturn) then
- rst:=[CAR rst,second rst,third rst, '"environment (omitted)"]
+ rst:=[first rst,second rst,third rst, '"environment (omitted)"]
for y in rst repeat
sayString('" ",out)
brightPrint1(y,out)
@@ -744,7 +744,7 @@ brightPrintHighlightAsTeX(x, out == $OutputStream) ==
sayString('"(",out)
brightPrint1(key,out)
if EQ(key,'TAGGEDreturn) then
- rst:=[CAR rst,second rst,third rst, '"environment (omitted)"]
+ rst:=[first rst,second rst,third rst, '"environment (omitted)"]
for y in rst repeat
sayString('" ",out)
brightPrint1(y,out)
@@ -772,9 +772,9 @@ brightPrintCenter(x,out == $OutputStream) ==
y := NIL
ok := true
while x and ok repeat
- if member(CAR(x),'(%l "%l")) then ok := NIL
- else y := cons(CAR x, y)
- x := CDR x
+ if member(first(x),'(%l "%l")) then ok := NIL
+ else y := cons(first x, y)
+ x := rest x
y := NREVERSE y
wid := sayBrightlyLength y
if wid < $LINELENGTH then
@@ -794,9 +794,9 @@ brightPrintCenterAsTeX(x, out == $OutputStream) ==
lst := x
while lst repeat
words := nil
- while lst and not CAR(lst) = "%l" repeat
- words := [CAR lst,: words]
- lst := CDR lst
+ while lst and not first(lst) = "%l" repeat
+ words := [first lst,: words]
+ lst := rest lst
if lst then lst := cdr lst
sayString('"\centerline{",out)
words := nreverse words
@@ -819,9 +819,9 @@ brightPrintRightJustify(x, out == $OutputStream) ==
y := NIL
ok := true
while x and ok repeat
- if member(CAR(x),'(%l "%l")) then ok := NIL
- else y := cons(CAR x, y)
- x := CDR x
+ if member(first(x),'(%l "%l")) then ok := NIL
+ else y := cons(first x, y)
+ x := rest x
y := NREVERSE y
wid := sayBrightlyLength y
if wid < $LINELENGTH then
diff --git a/src/interp/newfort.boot b/src/interp/newfort.boot
index 909302a7..81301b6d 100644
--- a/src/interp/newfort.boot
+++ b/src/interp/newfort.boot
@@ -199,8 +199,8 @@ beenHere(e,n) ==
-- using COPY-TREE : RPLAC does not smash $fortCsList
-- which led to inconsistencies in assignment of temp. vars.
$fortCsList := COPY_-TREE [['"=",var,e],:$fortCsList]
- loc := CAR exprStk
- fun := CAR n.3
+ loc := first exprStk
+ fun := first n.3
fun = 'CAR =>
RPLACA(loc,var)
fun = 'CDR =>
@@ -713,7 +713,7 @@ fortFormatCharacterTypes(names) ==
genuineArrays := []
for u in names repeat
ATOM u => sortedByLength := insertEntry(0,u,sortedByLength)
- #u=2 => sortedByLength := insertEntry(second u,CAR u,sortedByLength)
+ #u=2 => sortedByLength := insertEntry(second u,first u,sortedByLength)
genuineArrays := [u,:genuineArrays]
for u in sortedByLength repeat
fortFormatTypes1(mkCharName car u, [STRINGIMAGE(s) for s in cdr(u)]) where
diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot
index 7042c23c..b6d41bde 100644
--- a/src/interp/nrunfast.boot
+++ b/src/interp/nrunfast.boot
@@ -151,7 +151,7 @@ replaceGoGetSlot env ==
sayLooking1(['"goget stuffing slot",:bright thisSlot,'"of "],thisDomain)
setShellEntry(thisDomain,thisSlot,slot)
if $monitorNewWorld then
- sayLooking1('"<------",[CAR slot,:devaluate CDR slot])
+ sayLooking1('"<------",[first slot,:devaluate rest slot])
slot
--=======================================================
@@ -249,7 +249,7 @@ newLookupInAddChain(op,sig,addFormDomain,dollar) ==
addFunction =>
if $monitorNewWorld then
sayLooking1(concat('"<----add-chain function found for ",
- form2String devaluate addFormDomain,'"<----"),CDR addFunction)
+ form2String devaluate addFormDomain,'"<----"),rest addFunction)
addFunction
nil
@@ -309,7 +309,7 @@ newLookupInCategories(op,sig,dom,dollar) ==
not nrunNumArgCheck(#(QCDR sig),byteVector,opvec.code,endPos) => nil
--numOfArgs := byteVector.(opvec.code)
--numOfArgs ~= #(QCDR sig) => nil
- packageForm := [entry,'$,:CDR cat]
+ packageForm := [entry,'$,:rest cat]
package := evalSlotDomain(packageForm,dom)
packageVec.i := package
package
@@ -317,7 +317,7 @@ newLookupInCategories(op,sig,dom,dollar) ==
table := HGET($Slot1DataBase,entry) or systemError nil
(u := LASSQ(op,table))
and (v := or/[rest x for x in u | #sig = #x.0]) =>
- packageForm := [entry,'$,:CDR cat]
+ packageForm := [entry,'$,:rest cat]
package := evalSlotDomain(packageForm,dom)
packageVec.i := package
package
@@ -355,14 +355,14 @@ newLookupInCategories1(op,sig,dom,dollar) ==
predvec := dom.3
slot4 := dom.4
packageVec := CAR slot4
- catVec := CAR QCDR slot4
+ catVec := first QCDR slot4
--the next three lines can go away with new category world
varList := ['$,:$FormalMapVariableList]
valueList := [dom,:[dom.(5+i) for i in 1..(# rest dom.0)]]
valueList := [MKQ val for val in valueList]
nsig := MSUBST(dom.0,dollar.0,sig)
for i in 0..MAXINDEX packageVec | (entry := ELT(packageVec,i))
- and (VECP entry or (predIndex := CDR (node := ELT(catVec,i))) and
+ and (VECP entry or (predIndex := rest (node := ELT(catVec,i))) and
(EQ(predIndex,0) or testBitVector(predvec,predIndex))) repeat
package :=
VECP entry =>
@@ -383,14 +383,14 @@ newLookupInCategories1(op,sig,dom,dollar) ==
byteVector := CDDR infovec.3
numOfArgs := byteVector.(opvec.code)
numOfArgs ~= #(QCDR sig) => nil
- packageForm := [entry,'$,:CDR cat]
+ packageForm := [entry,'$,:rest cat]
package := evalSlotDomain(packageForm,dom)
packageVec.i := package
package
table := HGET($Slot1DataBase,entry) or systemError nil
(u := LASSQ(op,table))
and (v := or/[rest x for x in u | #sig = #x.0]) =>
- packageForm := [entry,'$,:CDR cat]
+ packageForm := [entry,'$,:rest cat]
package := evalSlotDomain(packageForm,dom)
packageVec.i := package
package
@@ -444,7 +444,7 @@ lazyMatchArg2(s,a,dollar,domain,typeFlag) ==
domainArg := ($isDefaultingPackage => domain.6.0; domain.0)
KAR s = QCAR d.0 and
lazyMatchArgDollarCheck(replaceSharpCalls s,d.0,dollar.0,domainArg)
- --VECP CAR d => lazyMatch(s,CDDR d,dollar,domain) --old style (erase)
+ --VECP first d => lazyMatch(s,CDDR d,dollar,domain) --old style (erase)
lazyMatch(replaceSharpCalls s,d,dollar,domain) --new style
a = '$ => s = devaluate dollar
a = "$$" => s = devaluate domain
@@ -461,8 +461,8 @@ lazyMatchArg2(s,a,dollar,domain,typeFlag) ==
--s = a
lazyMatch(source,lazyt,dollar,domain) ==
- lazyt is [op,:argl] and null atom source and op=CAR source
- and #(sargl := CDR source) = #argl =>
+ lazyt is [op,:argl] and null atom source and op=first source
+ and #(sargl := rest source) = #argl =>
op in '(Record Union) and first argl is [":",:.] =>
and/[stag = atag and lazyMatchArg(s,a,dollar,domain)
for [.,stag,s] in sargl for [.,atag,a] in argl]
@@ -495,7 +495,7 @@ lazyMatchArgDollarCheck(s,d,dollarName,domainName) ==
x = '$ and (arg = dollarName or arg = domainName) => true
x = dollarName and arg = domainName => true
ATOM x or ATOM arg => false
- xt and CAR x = CAR arg =>
+ xt and first x = first arg =>
lazyMatchArgDollarCheck(x,arg,dollarName,domainName)
false
@@ -521,7 +521,7 @@ lookupInDomainByName(op,domain,arg) ==
slotIndex := numvec.(i + 2 + numberOfArgs)
newStart := QSPLUS(start,QSPLUS(numberOfArgs,4))
slot := domain.slotIndex
- null atom slot and EQ(CAR slot,CAR arg) and EQ(CDR slot,CDR arg) => return (success := true)
+ null atom slot and EQ(first slot,first arg) and EQ(rest slot,rest arg) => return (success := true)
start := QSPLUS(start,QSPLUS(numberOfArgs,4))
success
@@ -595,7 +595,7 @@ lazyDomainSet(lazyForm,thisDomain,slot) ==
if $monitorNewWorld then
sayLooking1(concat(form2String devaluate thisDomain,
'" activating lazy slot ",slot,'": "),slotDomain)
- name := CAR form
+ name := first form
setShellEntry(thisDomain,slot,slotDomain)
@@ -648,7 +648,7 @@ newHasTest(domform,catOrAtt) ==
[pred,:l] := x
pred = "has" =>
l is [ w1,['ATTRIBUTE,w2]] => newHasTest(w1,w2)
- l is [ w1,['SIGNATURE,:w2]] => compiledLookup(CAR w2,second w2, eval mkEvalable w1)
+ l is [ w1,['SIGNATURE,:w2]] => compiledLookup(first w2,second w2, eval mkEvalable w1)
newHasTest(first l ,first rest l)
pred = 'OR => or/[evalCond i for i in l]
pred = 'AND => and/[evalCond i for i in l]
@@ -669,15 +669,15 @@ newHasTest(domform,catOrAtt) ==
lazyMatchAssocV(x,auxvec,catvec,domain) == --new style slot4
n := MAXINDEX catvec
- xop := CAR x
+ xop := first x
or/[ELT(auxvec,i) for i in 0..n |
- xop = CAR (lazyt := QVELT(catvec,i)) and lazyMatch(x,lazyt,domain,domain)]
+ xop = first (lazyt := QVELT(catvec,i)) and lazyMatch(x,lazyt,domain,domain)]
lazyMatchAssocV1(x,vec,domain) == --old style slot4
n := MAXINDEX vec
- xop := CAR x
+ xop := first x
or/[QCDR QVELT(vec,i) for i in 0..n |
- xop = CAR (lazyt := CAR QVELT(vec,i)) and lazyMatch(x,lazyt,domain,domain)]
+ xop = first (lazyt := first QVELT(vec,i)) and lazyMatch(x,lazyt,domain,domain)]
--newHasAttribute(domain,attrib) ==
-- predIndex := LASSOC(attrib,domain.2) =>
diff --git a/src/interp/nrungo.boot b/src/interp/nrungo.boot
index 9b8d74b9..fdc147bb 100644
--- a/src/interp/nrungo.boot
+++ b/src/interp/nrungo.boot
@@ -133,8 +133,8 @@ NRTreplaceLocalTypes(t,dom) ==
t:= dom.t
if CONSP t then t:= NRTevalDomain t
t.0
- CAR t in '(Mapping Union Record _:) =>
- [CAR t,:[NRTreplaceLocalTypes(x,dom) for x in rest t]]
+ first t in '(Mapping Union Record _:) =>
+ [first t,:[NRTreplaceLocalTypes(x,dom) for x in rest t]]
t
substDomainArgs(domain,object) ==
@@ -277,7 +277,7 @@ lazyCompareSigEqual(s,tslot,dollar,domain) ==
tslot = '$ => s = "$" or s = devaluate dollar
INTEGERP tslot and CONSP(lazyt:=domain.tslot) and CONSP s =>
lazyt is [.,.,.,[.,item,.]] and
- item is [.,[functorName,:.]] and functorName = CAR s =>
+ item is [.,[functorName,:.]] and functorName = first s =>
compareSigEqual(s,(NRTevalDomain lazyt).0,dollar,domain)
nil
compareSigEqual(s,NRTreplaceLocalTypes(tslot,domain),dollar,domain)
@@ -319,8 +319,8 @@ NRTcompiledLookup(op,sig,dom) ==
NRTtypeHack t ==
ATOM t => t
- CAR t = '_# => # second t
- [CAR t,:[NRTtypeHack tt for tt in CDR t]]
+ first t = '_# => # second t
+ [first t,:[NRTtypeHack tt for tt in rest t]]
NRTgetMinivectorIndex(u,op,sig,domVector) ==
s := # $minivector
diff --git a/src/interp/nrunopt.boot b/src/interp/nrunopt.boot
index 7f225a6c..ca6dc01f 100644
--- a/src/interp/nrunopt.boot
+++ b/src/interp/nrunopt.boot
@@ -132,7 +132,7 @@ orderBySubsumption items ==
-- entry is be ignored (e.g. init: -> $ in ULS)
while (u := assoc(b,subacc)) repeat b := second u
u := assoc(b,acc) or systemError nil
- if null second u then u := [CAR u,1] --mark as missing operation
+ if null second u then u := [first u,1] --mark as missing operation
y := [[a,'Subsumed],u,:y] --makes subsuming signature follow one subsumed
z := insert(b,z) --mark a signature as already present
[:y,:[w for (w := [c,:.]) in acc | not member(c,z)]] --add those not subsuming
@@ -163,9 +163,9 @@ stuffDomainSlots dollar ==
dollar.2 := infovec.2
proto4 := infovec.3
dollar.4 :=
- VECP CDDR proto4 => [COPY_-SEQ CAR proto4,:CDR proto4] --old style
+ VECP CDDR proto4 => [COPY_-SEQ first proto4,:rest proto4] --old style
bitVector := dollar.3
- predvec := CAR proto4
+ predvec := first proto4
packagevec := second proto4
auxvec := LIST2VEC [fn for i in 0..MAXINDEX predvec] where fn() ==
null testBitVector(bitVector,predvec.i) => nil
@@ -277,7 +277,7 @@ augmentPredVector(dollar,value) ==
isHasDollarPred pred ==
pred is [op,:r] =>
op in '(AND and OR or NOT not) => or/[isHasDollarPred x for x in r]
- op in '(HasCategory HasAttribute) => CAR r = '$
+ op in '(HasCategory HasAttribute) => first r = '$
false
stripOutNonDollarPreds pred ==
@@ -334,7 +334,7 @@ buildBitTable(:l) == fn(REVERSE l,0) where fn(l,n) ==
buildPredVector(init,n,l) == fn(init,2 ** n,l) where fn(acc,n,l) ==
null l => acc
- if CAR l then acc := acc + n
+ if first l then acc := acc + n
fn(acc,n + n,rest l)
testBitVector(vec,i) ==
@@ -362,7 +362,7 @@ NRTmakeCategoryAlist() ==
sixEtc := [5 + i for i in 1..#$pairlis]
formals := ASSOCRIGHT $pairlis
for x in slot1 repeat
- RPLACA(x,EQSUBSTLIST(CONS("$$",sixEtc),CONS('$,formals),CAR x))
+ RPLACA(x,EQSUBSTLIST(CONS("$$",sixEtc),CONS('$,formals),first x))
-----------code to make a new style slot4 -----------------
predList := ASSOCRIGHT slot1 --is list of predicate indices
maxPredList := "MAX"/predList
@@ -391,7 +391,7 @@ hasDefaultPackage catname ==
--=======================================================================
-- Generate Category Level Alist
--=======================================================================
-orderCatAnc x == NREVERSE ASSOCLEFT SORTBY('CDR,CDR depthAssoc x)
+orderCatAnc x == NREVERSE ASSOCLEFT SORTBY('CDR,rest depthAssoc x)
depthAssocList u ==
u := delete('DomainSubstitutionMacro,u) --hack by RDJ 8/90
@@ -507,7 +507,7 @@ getCodeVector() ==
proto4 := $infovec.3
u := CDDR proto4
VECP u => u --old style
- CDR u --new style
+ rest u --new style
formatSlotDomain x ==
x = 0 => ["$"]
@@ -593,7 +593,7 @@ dcCats con ==
u := $infovec.3
VECP CDDR u => dcCats1 con --old style slot4
$predvec:= getConstructorPredicatesFromDB con
- catpredvec := CAR u
+ catpredvec := first u
catinfo := second u
catvec := third u
for i in 0..MAXINDEX catvec repeat
@@ -613,7 +613,7 @@ dcCats1 con ==
$predvec:= getConstructorPredicatesFromDB con
u := $infovec.3
catvec := second u
- catinfo := CAR u
+ catinfo := first u
for i in 0..MAXINDEX catvec repeat
sayBrightlyNT bright i
[form,:predNumber] := catvec.i
@@ -632,7 +632,7 @@ dcData con ==
sayBrightly '"Operation data from slot 1"
PRINT_-FULL $infovec.1
vec := getCodeVector()
- vec := (CONSP vec => CDR vec; vec)
+ vec := (CONSP vec => rest vec; vec)
sayBrightly ['"Information vector has ",SIZE vec,'" entries"]
dcData1 vec
@@ -677,7 +677,7 @@ dcSize(:options) ==
VECP CDDR slot4 => second slot4
third slot4
n := MAXINDEX catvec
- cSize := sum(nodeSize(2),vectorSize(SIZE CAR slot4),vectorSize(n + 1),
+ cSize := sum(nodeSize(2),vectorSize(SIZE first slot4),vectorSize(n + 1),
nodeSize(+/[numberOfNodes catvec.i for i in 0..n]))
codeVector :=
VECP CDDR slot4 => CDDR slot4
@@ -870,7 +870,7 @@ catExtendsCat?(u,v,uvec) ==
u = v => true
uvec := uvec or (compMakeCategoryObject(u,$EmptyEnvironment)).expr
slot4 := uvec.4
- prinAncestorList := CAR slot4
+ prinAncestorList := first slot4
member(v,prinAncestorList) => true
vOp := KAR v
if similarForm := assoc(vOp,prinAncestorList) then
diff --git a/src/interp/packtran.boot b/src/interp/packtran.boot
index 89593899..53f2aa4c 100644
--- a/src/interp/packtran.boot
+++ b/src/interp/packtran.boot
@@ -46,8 +46,8 @@ packageTran sex ==
EQ(_*PACKAGE_*, SYMBOL_-PACKAGE sex) => sex
INTERN STRING sex
CONSP sex =>
- RPLACA(sex, packageTran CAR sex)
- RPLACD(sex, packageTran CDR sex)
+ RPLACA(sex, packageTran first sex)
+ RPLACD(sex, packageTran rest sex)
sex
sex
diff --git a/src/interp/pf2atree.boot b/src/interp/pf2atree.boot
index 20227e79..6002cbf0 100644
--- a/src/interp/pf2atree.boot
+++ b/src/interp/pf2atree.boot
@@ -273,10 +273,10 @@ pfApplication2Atree pf ==
op := packageTran ((opTran)(pfOp2Sex)(opPf))
op = "->" =>
args := (pf0TupleParts)((pfApplicationArg)(pf))
- if (pfTuple?)(CAR args) then
- typeList := [pf2Atree1 arg for arg in (pf0TupleParts)(CAR args)]
+ if (pfTuple?)(first args) then
+ typeList := [pf2Atree1 arg for arg in (pf0TupleParts)(first args)]
else
- typeList := [pf2Atree1 CAR args]
+ typeList := [pf2Atree1 first args]
args := [pf2Atree1 second args, :typeList]
[mkAtreeNodeWithSrcPos("Mapping", opPf), :args]
@@ -321,7 +321,7 @@ pfApplication2Atree pf ==
-- handle package call
(pfFromdom?)(opPf) =>
opAtree := pf2Atree1 opPf
- [CAR opAtree, second opAtree, [third opAtree, :argAtree]]
+ [first opAtree, second opAtree, [third opAtree, :argAtree]]
-- regular call
[mkAtreeNodeWithSrcPos(op,opPf), :argAtree]
@@ -337,13 +337,13 @@ pfApplication2Atree pf ==
-- handle package call
(pfFromdom?)(opPf) =>
opAtree := pf2Atree1 opPf
- [CAR opAtree, second opAtree, [third opAtree, pf2Atree1 args]]
+ [first opAtree, second opAtree, [third opAtree, pf2Atree1 args]]
-- regular call
[mkAtreeNodeWithSrcPos(op,opPf), pf2Atree1 args]
-- pfDefinition2Atree pf ==
-- --! $insideApplication =>
--- --! ["OPTARG", pf2Atree1 CAR pf0DefinitionLhsItems pf,
+-- --! ["OPTARG", pf2Atree1 first pf0DefinitionLhsItems pf,
-- --! pf2Atree1 pfDefinitionRhs pf]
-- idList := [pf2Atree1 x for x in (pf0DefinitionLhsItems)(pf)]
-- #idList ~= 1 =>
@@ -489,7 +489,7 @@ pfCollect2Atree pf ==
-- for pred in $predicateList repeat
-- [name, predLhs, :predRhs] := pred
-- vars := patternVarsOf predRhs
--- CDR vars => -- if there is more than one patternVariable
+-- rest vars => -- if there is more than one patternVariable
-- ruleLhs := NSUBST(predLhs, name, ruleLhs)
-- $multiVarPredicateList := [pred, :$multiVarPredicateList]
-- predicate :=
@@ -503,7 +503,7 @@ pfCollect2Atree pf ==
-- null $multiVarPredicateList => rule
-- varList := patternVarsOf [rhs for [.,.,:rhs] in $multiVarPredicateList]
-- predBody :=
--- CDR $multiVarPredicateList =>
+-- rest $multiVarPredicateList =>
-- ['AND, :[:pvarPredTran(rhs, varList) for [.,.,:rhs] in
-- $multiVarPredicateList]]
-- [[.,.,:rhs],:.] := $multiVarPredicateList
@@ -549,7 +549,7 @@ pfCollect2Atree pf ==
-- pfSuchThat2Atree args ==
-- name := GENSYM()
-- argList := pf0TupleParts args
--- lhsSex := pf2Atree1 CAR argList
+-- lhsSex := pf2Atree1 first argList
-- rhsSex := pf2Atree second argList
-- $predicateList := [[name, lhsSex, :rhsSex], :$predicateList]
-- name
diff --git a/src/interp/pf2sex.boot b/src/interp/pf2sex.boot
index ebb76bf1..01053dc6 100644
--- a/src/interp/pf2sex.boot
+++ b/src/interp/pf2sex.boot
@@ -427,7 +427,7 @@ ruleLhsTran ruleLhs ==
for pred in $predicateList repeat
[name, predLhs, :predRhs] := pred
vars := patternVarsOf predRhs
- CDR vars => -- if there is more than one patternVariable
+ rest vars => -- if there is more than one patternVariable
ruleLhs := NSUBST(predLhs, name, ruleLhs)
$multiVarPredicateList := [pred, :$multiVarPredicateList]
predicate :=
@@ -441,7 +441,7 @@ rulePredicateTran rule ==
null $multiVarPredicateList => rule
varList := patternVarsOf [rhs for [.,.,:rhs] in $multiVarPredicateList]
predBody :=
- CDR $multiVarPredicateList =>
+ rest $multiVarPredicateList =>
['AND, :[:pvarPredTran(rhs, varList) for [.,.,:rhs] in
$multiVarPredicateList]]
[[.,.,:rhs],:.] := $multiVarPredicateList
diff --git a/src/interp/pile.boot b/src/interp/pile.boot
index 4f749ba9..83e6b584 100644
--- a/src/interp/pile.boot
+++ b/src/interp/pile.boot
@@ -46,7 +46,7 @@ namespace BOOT
-- the root of the first tree is concatenated with its forest.
-- column t is the number of spaces before the first non-space in line t
-pileColumn t==CDR tokPosn CAAR t
+pileColumn t== rest tokPosn CAAR t
pileComment t== EQ(tokType CAAR t,"negcomment")
pilePlusComment t== EQ(tokType CAAR t,"comment")
@@ -84,9 +84,9 @@ pileTree(n,s)==
then [false,n,[],s]
else
[h,t]:=[car s,cdr s]
- hh:=pileColumn CAR h
+ hh:=pileColumn first h
if hh > n
- then pileForests(CAR h,hh,t)
+ then pileForests(first h,hh,t)
else [false,n,[],s]
eqpileTree(n,s)==
@@ -94,9 +94,9 @@ eqpileTree(n,s)==
then [false,n,[],s]
else
[h,t]:=[car s,cdr s]
- hh:=pileColumn CAR h
+ hh:=pileColumn first h
if hh = n
- then pileForests(CAR h,hh,t)
+ then pileForests(first h,hh,t)
else [false,n,[],s]
pileForest(n,s)==
diff --git a/src/interp/profile.boot b/src/interp/profile.boot
index df0ea732..54b122ed 100644
--- a/src/interp/profile.boot
+++ b/src/interp/profile.boot
@@ -58,7 +58,7 @@ profileRecord(label,name,info) == --name: info is var: type or op: sig
-- alist2 is ((name . info) ...)
if $insideCapsuleFunctionIfTrue then
op := $op
- argl := CDR $form
+ argl := rest $form
opSig := [$op,$signatureOfForm]
else
op := 'constructor
diff --git a/src/interp/pspad1.boot b/src/interp/pspad1.boot
index 032bca6a..380c6bae 100644
--- a/src/interp/pspad1.boot
+++ b/src/interp/pspad1.boot
@@ -106,8 +106,8 @@ fragmentsToLine fragments ==
lispStringList2String x ==
null x => '""
atom x => STRINGIMAGE x
- CDR x => APPLY(function STRCONC,MAPCAR(function lispStringList2String,x))
- lispStringList2String CAR x
+ rest x => APPLY(function STRCONC,MAPCAR(function lispStringList2String,x))
+ lispStringList2String first x
--% routines for buffer and margin adjustment
@@ -266,8 +266,8 @@ format(x,:options) ==
op is ['elt,y,"construct"] => formatDollar(y,'construct,argl)
op is ['elt,name,p] and UPPER_-CASE_-P (STRINGIMAGE opOf name).0 =>
formatDollar(name,p,argl)
- op = 'elt and UPPER_-CASE_-P (STRINGIMAGE opOf CAR argl).0 =>
- formatDollar1(CAR argl,second argl)
+ op = 'elt and UPPER_-CASE_-P (STRINGIMAGE opOf first argl).0 =>
+ formatDollar1(first argl,second argl)
fn:= GETL(op,"PSPAD") => formatFn(fn,x,$m,$c)
if op in '(AND OR NOT) then op:= DOWNCASE op
n=1 and GETL(op,'Nud) and (lbp:= formatOpBindingPower(op,"Nud","left")) =>
diff --git a/src/interp/pspad2.boot b/src/interp/pspad2.boot
index 0928d565..6078d610 100644
--- a/src/interp/pspad2.boot
+++ b/src/interp/pspad2.boot
@@ -72,7 +72,7 @@ formatDeftran(u,SEQflag) ==
[:m,y] := [:a,:b]
['SEQ,:m,['exit,n,y]]
-- u is ['not,arg] and (op := LASSOC(KAR arg,'((_= . _~_=) (_< . _>_=)))) =>
--- formatDeftran([op,:CDR arg],nil)
+-- formatDeftran([op,:rest arg],nil)
u is ["^",a] => formatDeftran(['not,a],SEQflag)
u is ["exquo",a,b] => formatDeftran(['xquo,a,b],SEQflag)
u is ['IF,a,b,c] =>
@@ -156,7 +156,7 @@ formatDeftranJoin(u,SEQflag) ==
['Join,:cats,lastcat] := u
lastcat is ['CATEGORY,kind,:l,x] =>
cat :=
- CDR cats => ['Join,:cats]
+ rest cats => ['Join,:cats]
first cats
formatDeftran(['with,cat,['SEQ,:l,['exit,1,x]]],SEQflag)
u
@@ -189,7 +189,7 @@ formatDeftranIf(a,b,c) ==
[["=>", ['not, a], c]]
post :=
c = '%noBranch => nil
- c is ['SEQ,:.] => CDR c
+ c is ['SEQ,:.] => rest c
[c]
[["=>",a,b],:post]
@@ -641,7 +641,7 @@ formatLB() ==
restoreC() == --used by macro "embrace"
originalC := CAR $braceStack
- $braceStack := CDR $braceStack
+ $braceStack := rest $braceStack
formatRB originalC
saveC() == --used by macro "embrace"
@@ -652,7 +652,7 @@ saveD() == --used by macro "embrace"
restoreD() == --used by macro "indentNB"
originalC := CAR $braceStack
- $braceStack := CDR $braceStack
+ $braceStack := rest $braceStack
originalC
formatRB(originalC) == --called only by restoreC
diff --git a/src/interp/rulesets.boot b/src/interp/rulesets.boot
index 73006b44..aa851141 100644
--- a/src/interp/rulesets.boot
+++ b/src/interp/rulesets.boot
@@ -295,7 +295,7 @@ createTypeEquivRules() ==
((QF (P t1)) . (RF t1))
((QF (I)) . (RN))
((RE (RN)) . (RR)) )))
- $TypeEqui := CONS(CAR $TypeEQ, [[b,:a] for [a,:b] in CDR $TypeEQ])
+ $TypeEqui := CONS(CAR $TypeEQ, [[b,:a] for [a,:b] in rest $TypeEQ])
true
initializeRuleSets() ==
diff --git a/src/interp/scan.boot b/src/interp/scan.boot
index 21b849f4..c8b9dfe8 100644
--- a/src/interp/scan.boot
+++ b/src/interp/scan.boot
@@ -247,7 +247,7 @@ for i in [ _
["LARROW" ,"<-"], _
["BAR" ,"|"], _
["SEG" ,".."] _
- ] repeat MAKEPROP(CAR i,'INFGENERIC,second i)
+ ] repeat MAKEPROP(first i,'INFGENERIC,second i)
-- Scanner
@@ -269,9 +269,9 @@ nextline(s)==
if npNull s
then false
else
- $f:= CAR s
- $r:= CDR s
- $ln := CDR $f
+ $f:= first s
+ $r:= rest s
+ $ln := rest $f
$linepos:=CAAR $f
$n:=STRPOSL('" ",$ln,0,true)-- spaces at beginning
$sz :=# $ln
diff --git a/src/interp/server.boot b/src/interp/server.boot
index 6f85dc95..a80696d9 100644
--- a/src/interp/server.boot
+++ b/src/interp/server.boot
@@ -142,7 +142,7 @@ parseAndEvalToStringEqNum str ==
parseAndInterpToString str ==
v := applyWithOutputToString('parseAndEvalStr, [str])
- breakIntoLines CDR v
+ breakIntoLines rest v
parseAndEvalStr string ==
$InteractiveMode :fluid := true
diff --git a/src/interp/setvars.boot b/src/interp/setvars.boot
index a35a2f30..cbe6872a 100644
--- a/src/interp/setvars.boot
+++ b/src/interp/setvars.boot
@@ -190,7 +190,7 @@ useFastLinks flag ==
set1(l,setTree) ==
null l => displaySetVariableSettings(setTree,"")
$setOptionNames : local := [x.0 for x in setTree]
- arg := selectOption(DOWNCASE CAR l,$setOptionNames,'optionError)
+ arg := selectOption(DOWNCASE first l,$setOptionNames,'optionError)
setData := [arg,:LASSOC(arg,setTree)]
-- check is the user is authorized for the set variable
@@ -664,8 +664,8 @@ setFortTmpDir arg ==
validateOutputDirectory x ==
- AND(PATHNAME_-DIRECTORY(PROBE_-FILE(CAR(x))), NOT PATHNAME_-NAME (PROBE_-FILE(CAR(x)))) =>
- CAR(x)
+ AND(PATHNAME_-DIRECTORY(PROBE_-FILE(first(x))), NOT PATHNAME_-NAME (PROBE_-FILE(first(x)))) =>
+ first(x)
NIL
diff --git a/src/interp/sfsfun.boot b/src/interp/sfsfun.boot
index b26c2dd6..5090f0c5 100644
--- a/src/interp/sfsfun.boot
+++ b/src/interp/sfsfun.boot
@@ -83,7 +83,7 @@ fracpart(x) ==
second(MULTIPLE_-VALUE_-LIST(FLOOR(x)))
intpart(x) ==
- CAR(MULTIPLE_-VALUE_-LIST(FLOOR(x)))
+ first(MULTIPLE_-VALUE_-LIST(FLOOR(x)))
negintp(x) ==
if ZEROP IMAGPART(x) and x<0.0 and ZEROP fracpart(x)
@@ -156,7 +156,7 @@ gammaRatapprox (x) ==
else
Pi := PI
lx := MULTIPLE_-VALUE_-LIST(FLOOR(x))
- intpartx := CAR(lx)+1
+ intpartx := first(lx)+1
restx := second(lx)
if ZEROP restx -- case of negative non-integer value
then
@@ -812,7 +812,7 @@ besselIback(v,z) ==
ipv := IMAGPART(v)
rpv := REALPART(v)
lm := MULTIPLE_-VALUE_-LIST(FLOOR(rpv))
- m := CAR(lm) --- floor of real part of v
+ m := first(lm) --- floor of real part of v
n := 2*MAX(20,m+10) --- how large the back recurrence should be
tv := second(lm)+(v-rpv) --- fractional part of real part of v
--- plus imaginary part of v
diff --git a/src/interp/showimp.boot b/src/interp/showimp.boot
index b70c3206..140c57c3 100644
--- a/src/interp/showimp.boot
+++ b/src/interp/showimp.boot
@@ -72,7 +72,7 @@ showImp(dom,:options) ==
--first display those exported by the domain, then add chain guys
u := [:domexports,:constants,:SORTBY('CDDR,others)]
while u repeat
- [.,.,:key] := CAR u
+ [.,.,:key] := first u
sayBrightly
key = 'constant =>
["Constants implemented by",:bright form2String key,'":"]
@@ -80,14 +80,14 @@ showImp(dom,:options) ==
u := showDomainsOp1(u,key)
u := SORTBY('CDDR,defexports)
while u repeat
- [.,.,:key] := CAR u
- defop := INTERN(SUBSTRING((s := PNAME CAR key),0,MAXINDEX s))
+ [.,.,:key] := first u
+ defop := INTERN(SUBSTRING((s := PNAME first key),0,MAXINDEX s))
domainForm := [defop,:CDDR key]
sayBrightly ["Default functions from",:bright form2String domainForm,'":"]
u := showDomainsOp1(u,key)
u := SORTBY('CDDR,unexports)
while u repeat
- [.,.,:key] := CAR u
+ [.,.,:key] := first u
sayBrightly ["Not exported: "]
u := showDomainsOp1(u,key)
@@ -113,22 +113,22 @@ showFrom(D,:option) ==
--=======================================================================
getDomainOps D ==
domname := D.0
- conname := CAR domname
+ conname := first domname
$predicateList: local := getConstructorPredicatesFromDB conname
REMDUP listSort(function GLESSEQP,ASSOCLEFT getDomainOpTable(D,nil))
getDomainSigs(D,:option) ==
domname := D.0
- conname := CAR domname
+ conname := first domname
$predicateList: local := getConstructorPredicatesFromDB conname
getDomainSigs1(D,first option)
getDomainSigs1(D,ops) == listSort(function GLESSEQP,u) where
- u() == [x for x in getDomainOpTable(D,nil) | null ops or MEMQ(CAR x,ops)]
+ u() == [x for x in getDomainOpTable(D,nil) | null ops or MEMQ(first x,ops)]
getDomainDocs(D,:option) ==
domname := D.0
- conname := CAR domname
+ conname := first domname
$predicateList: local := getConstructorPredicatesFromDB conname
ops := KAR option
[[op,sig,:getInheritanceByDoc(D,op,sig)] for [op,sig] in getDomainSigs1(D,ops)]
@@ -180,14 +180,14 @@ getInheritanceByDoc(D,op,sig,:options) ==
where fn() == getDocDomainForOpSig(op,sig,substDomainArgs(D,x),D)
getDocDomainForOpSig(op,sig,dollar,D) ==
- (u := LASSOC(op,getConstructorDocumentationFromDB CAR dollar))
+ (u := LASSOC(op,getConstructorDocumentationFromDB first dollar))
and (doc := or/[[d,dollar] for [s,:d] in u | compareSig(sig,s,D,dollar)])
--=======================================================================
-- Functions implementing showImp
--=======================================================================
showDomainsOp1(u,key) ==
- while u and CAR u is [op,sig,: =key] repeat
+ while u and first u is [op,sig,: =key] repeat
sayBrightly ['" ",:formatOpSignature(op,sig)]
u := rest u
u
@@ -208,7 +208,7 @@ getDomainSeteltForm ["setShellEntry",.,.,form] ==
showPredicates dom ==
sayBrightly '"--------------------Predicate summary-------------------"
- conname := CAR dom.0
+ conname := first dom.0
predvector := dom.3
predicateList := getConstructorPredicatesFromDB conname
for i in 1.. for p in predicateList repeat
@@ -219,7 +219,7 @@ showPredicates dom ==
showAttributes dom ==
sayBrightly '"--------------------Attribute summary-------------------"
- conname := CAR dom.0
+ conname := first dom.0
abb := getConstructorAbbreviation conname
predvector := dom.3
for [a,:p] in dom.2 repeat
diff --git a/src/interp/slam.boot b/src/interp/slam.boot
index 0851b32b..72a634c5 100644
--- a/src/interp/slam.boot
+++ b/src/interp/slam.boot
@@ -159,8 +159,8 @@ assocCircular(x,al) == --like ASSOC except that al is circular
forwardPointer:= al
val:= nil
until EQ(forwardPointer,al) repeat
- EQUAL(CAAR forwardPointer,x) => return (val:= CAR forwardPointer)
- forwardPointer:= CDR forwardPointer
+ EQUAL(CAAR forwardPointer,x) => return (val:= first forwardPointer)
+ forwardPointer:= rest forwardPointer
val
compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) ==
diff --git a/src/interp/termrw.boot b/src/interp/termrw.boot
index 36380e04..937dcdf4 100644
--- a/src/interp/termrw.boot
+++ b/src/interp/termrw.boot
@@ -58,14 +58,14 @@ term1RW(t,R) ==
for r in varRules until not (SL='failed) repeat
SL:= termMatch(CAR r,t,NIL,vars)
not (SL='failed) =>
- t:= subCopy(copy CDR r,SL)
+ t:= subCopy(copy rest r,SL)
t
term1RWall(t,R) ==
-- same as term1RW, but returns a list
[vars,:varRules]:= R
- [not (SL='failed) and subCopy(copy CDR r,SL) for r in varRules |
- not EQ(SL:= termMatch(CAR r,t,NIL,vars),'failed)]
+ [not (SL='failed) and subCopy(copy rest r,SL) for r in varRules |
+ not EQ(SL:= termMatch(first r,t,NIL,vars),'failed)]
termMatch(tp,t,SL,vars) ==
-- t is a term pattern, t a term
@@ -73,7 +73,7 @@ termMatch(tp,t,SL,vars) ==
tp=t => SL
atom tp =>
MEMQ(tp,vars) =>
- p:= ASSOC(tp,SL) => ( CDR p=t )
+ p:= ASSOC(tp,SL) => ( rest p=t )
CONS(CONS(tp,t),SL)
'failed
atom t => 'failed
@@ -93,14 +93,14 @@ termMatch(tp,t,SL,vars) ==
-- -- v must not be NIL
-- EQ(v,t) => 'T
-- atom t => NIL
--- isContained(v,CAR t) or isContained(v,CDR t)
+-- isContained(v,first t) or isContained(v,rest t)
augmentSub(v,t,SL) ==
-- destructively adds the pair (v,t) to the substitution list SL
-- t doesn't contain any of the variables of SL
q:= CONS(v,t)
null SL => [q]
--- for p in SL repeat RPLACD(p,SUBSTQ(t,v,CDR p))
+-- for p in SL repeat RPLACD(p,SUBSTQ(t,v,rest p))
CONS(q,SL)
mergeSubs(S1,S2) ==
@@ -108,8 +108,8 @@ mergeSubs(S1,S2) ==
-- S1 doesn't contain any of the variables of S2
null S1 => S2
null S2 => S1
- S3 := [p for p in S2 | not ASSQ(CAR p, S1)]
--- for p in S1 repeat S3:= augmentSub(CAR p,CDR p,S3)
+ S3 := [p for p in S2 | not ASSQ(first p, S1)]
+-- for p in S1 repeat S3:= augmentSub(first p,rest p,S3)
APPEND(S1,S3)
subCopy(t,SL) ==
@@ -119,7 +119,7 @@ subCopy(t,SL) ==
subCopy0(t,SL)
subCopy0(t, SL) ==
- p := subCopyOrNil(t, SL) => CDR p
+ p := subCopyOrNil(t, SL) => rest p
t
subCopyOrNil(t,SL) ==
@@ -128,9 +128,9 @@ subCopyOrNil(t,SL) ==
atom t => NIL
[t1,:t2]:= t
t0:= subCopyOrNil(t1,SL) =>
- t2 => CONS(t, CONS(CDR t0, subCopy0(t2,SL)))
- CONS(t,CONS(CDR t0,t2))
- t2 and ( t0:= subCopyOrNil(t2,SL) ) => CONS(t, CONS(t1,CDR t0))
+ t2 => CONS(t, CONS(rest t0, subCopy0(t2,SL)))
+ CONS(t,CONS(rest t0,t2))
+ t2 and ( t0:= subCopyOrNil(t2,SL) ) => CONS(t, CONS(t1,rest t0))
NIL
@@ -141,17 +141,17 @@ deepSubCopy(t,SL) ==
deepSubCopy0(t,SL)
deepSubCopy0(t, SL) ==
- p := deepSubCopyOrNil(t, SL) => CDR p
+ p := deepSubCopyOrNil(t, SL) => rest p
t
deepSubCopyOrNil(t,SL) ==
-- the same as subCopy, but the result is NIL if nothing was copied
- p:= ASSOC(t,SL) => CONS(t, deepSubCopy0(CDR p, SL))
+ p:= ASSOC(t,SL) => CONS(t, deepSubCopy0(rest p, SL))
atom t => NIL
[t1,:t2]:= t
t0:= deepSubCopyOrNil(t1,SL) =>
- t2 => CONS(t, CONS(CDR t0, deepSubCopy0(t2,SL)))
- CONS(t,CONS(CDR t0,t2))
- t2 and ( t0:= deepSubCopyOrNil(t2,SL) ) => CONS(t, CONS(t1,CDR t0))
+ t2 => CONS(t, CONS(rest t0, deepSubCopy0(t2,SL)))
+ CONS(t,CONS(rest t0,t2))
+ t2 and ( t0:= deepSubCopyOrNil(t2,SL) ) => CONS(t, CONS(t1,rest t0))
diff --git a/src/interp/topics.boot b/src/interp/topics.boot
index f8d84dac..5c3dcfc3 100644
--- a/src/interp/topics.boot
+++ b/src/interp/topics.boot
@@ -109,14 +109,14 @@ mkTopicHashTable() == --given $groupAssoc = ((extended .
--initialize table of topic classes
$topicHash := MAKE_-HASHTABLE 'ID --$topicHash has keys: topic and value: index
for [x,:c] in $groupAssoc repeat HPUT($topicHash,x,c)
- $topicIndex := CDR LAST $groupAssoc
+ $topicIndex := rest LAST $groupAssoc
--replace each property list by a topic code
--store under each construct an OR of all codes
for con in HKEYS $conTopicHash repeat
conCode := 0
for pair in HGET($conTopicHash,con) repeat
- RPLACD(pair,code := topicCode CDR pair)
+ RPLACD(pair,code := topicCode rest pair)
conCode := LOGIOR(conCode,code)
HPUT($conTopicHash,con,
[['constructor,:conCode],:HGET($conTopicHash,con)])
@@ -198,7 +198,7 @@ tdAdd(con,hash) ==
v := HGET($conTopicHash,con)
u := addTopic2Documentation(con,v)
--u := getConstructorDocumentationFromDB con
- for pair in u | FIXP (code := myLastAtom pair) and (op := CAR pair) ~= 'construct repeat
+ for pair in u | FIXP (code := myLastAtom pair) and (op := first pair) ~= 'construct repeat
for x in (names := code2Classes code) repeat HPUT(hash,x,insert(op,HGET(hash,x)))
tdPrint hash ==
diff --git a/src/interp/trace.boot b/src/interp/trace.boot
index ca3b3698..2b874c2d 100644
--- a/src/interp/trace.boot
+++ b/src/interp/trace.boot
@@ -108,7 +108,7 @@ trace1 l ==
hasOption($options,'stats) =>
(1 < # $options) =>
throwKeyedMsg("S2IT0001",['")trace ... )stats"])
- [.,:opt] := CAR $options
+ [.,:opt] := first $options
-- look for )trace )stats to list the statistics
-- )trace )stats reset to reset them
null opt => -- list the statistics
@@ -321,12 +321,12 @@ removeTracedMapSigs untraceList ==
coerceTraceArgs2E(traceName,subName,args) ==
MEMQ(name:= subName,$mathTraceList) =>
- SPADSYSNAMEP PNAME name => coerceSpadArgs2E(reverse CDR reverse args)
+ SPADSYSNAMEP PNAME name => coerceSpadArgs2E(reverse rest reverse args)
[["=",name,objValUnwrap coerceInteractive(objNewWrap(arg,type),$OutputForm)]
for name in '(arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12 arg13 arg14 arg15 arg16 arg17 arg18 arg19 )
- for arg in args for type in CDR LASSOC(subName,
+ for arg in args for type in rest LASSOC(subName,
$tracedMapSignatures)]
- SPADSYSNAMEP PNAME name => reverse CDR reverse args
+ SPADSYSNAMEP PNAME name => reverse rest reverse args
args
coerceSpadArgs2E(args) ==
@@ -334,7 +334,7 @@ coerceSpadArgs2E(args) ==
$streamCount:local := 0
[["=",name,objValUnwrap coerceInteractive(objNewWrap(arg,type),$OutputForm)]
for name in '(arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12 arg13 arg14 arg15 arg16 arg17 arg18 arg19 )
- for arg in args for type in CDR $tracedSpadModemap]
+ for arg in args for type in rest $tracedSpadModemap]
subTypes(mm,sublist) ==
ATOM mm =>
@@ -346,14 +346,14 @@ coerceTraceFunValue2E(traceName,subName,value) ==
MEMQ(name:= subName,$mathTraceList) =>
SPADSYSNAMEP PNAME traceName => coerceSpadFunValue2E(value)
(u:=LASSOC(subName,$tracedMapSignatures)) =>
- objValUnwrap coerceInteractive(objNewWrap(value,CAR u),$OutputForm)
+ objValUnwrap coerceInteractive(objNewWrap(value,first u),$OutputForm)
value
value
coerceSpadFunValue2E(value) ==
-- following binding is to prevent forcing calculation of stream elements
$streamCount:local := 0
- objValUnwrap coerceInteractive(objNewWrap(value,CAR $tracedSpadModemap),
+ objValUnwrap coerceInteractive(objNewWrap(value,first $tracedSpadModemap),
$OutputForm)
isListOfIdentifiers l == and/[IDENTP x for x in l]
@@ -404,7 +404,7 @@ augmentTraceNames(l,mapSubNames) ==
isSubForRedundantMapName(subName) ==
mapName:= rassocSub(subName,$mapSubNameAlist) =>
tail:=member([mapName,:subName],$mapSubNameAlist) =>
- MEMQ(mapName,CDR ASSOCLEFT tail)
+ MEMQ(mapName,rest ASSOCLEFT tail)
untraceMapSubNames traceNames ==
null($mapSubNameAlist:local:= getPreviousMapSubNames traceNames) => nil
@@ -425,7 +425,7 @@ isTraceGensym x == GENSYMP x
spadTrace(domain,options) ==
$fromSpadTrace:= true
$tracedModemap:local:= nil
- CONSP domain and REFVECP CAR domain and (CAR domain).0 = 0 =>
+ CONSP domain and REFVECP first domain and (first domain).0 = 0 =>
aldorTrace(domain,options)
not isDomainOrPackage domain => userError '"bad argument to trace"
listOfOperations:=
diff --git a/src/interp/wi1.boot b/src/interp/wi1.boot
index e182ef82..6e0ed234 100644
--- a/src/interp/wi1.boot
+++ b/src/interp/wi1.boot
@@ -265,11 +265,11 @@ compNoStacking(xOrig,m,e) ==
markKillAllRecursive x ==
x is [op,:r] =>
--->op = 'PART => markKillAllRecursive second r
- op = 'PART => ['PART, CAR r, markKillAllRecursive second r]
+ op = 'PART => ['PART, first r, markKillAllRecursive second r]
----------------------------------------------------------94/10/11
constructor? op => markKillAll x
- op = 'elt and constructor? opOf CAR r =>
- ['elt,markKillAllRecursive CAR r,second r]
+ op = 'elt and constructor? opOf first r =>
+ ['elt,markKillAllRecursive first r,second r]
x
x
@@ -593,7 +593,7 @@ setqSingle(id,val,m,E) ==
else form:=
$QuickLet => ["%LET",id,x]
["%LET",id,x,
- (isDomainForm(x,e') => ['ELT,id,0];CAR outputComp(id,e'))]
+ (isDomainForm(x,e') => ['ELT,id,0];first outputComp(id,e'))]
[form,m',e']
setqMultiple(nameList,val,m,e) ==
@@ -1214,7 +1214,7 @@ compDefineCategory2(form,signature,specialCases,body,m,e,
formals:=actuals:=nil
for u in $extraParms repeat
formals:=[CAR u,:formals]
- actuals:=[MKQ CDR u,:actuals]
+ actuals:=[MKQ rest u,:actuals]
body := ['sublisV,['PAIR,['QUOTE,formals],['LIST,:actuals]],body]
if argl then body:= -- always subst for args after extraparms
['sublisV,['PAIR,['QUOTE,sargl],['LIST,:
diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot
index f11f6b4f..24db34d1 100644
--- a/src/interp/wi2.boot
+++ b/src/interp/wi2.boot
@@ -132,7 +132,7 @@ compDefineFunctor1(df, m,$e,$prefix,$formalArgList) ==
while cb repeat
ATOM cb => return nil
cb is [["%LET",'Rep,v,:.],:.] => return (u:=v)
- cb:=CDR cb
+ cb:=rest cb
u
then $e:= augModemapsFromCategoryRep('_$,ab,cb,target,$e)
else $e:= augModemapsFromCategory('_$,'_$,'_$,target,$e)
@@ -243,7 +243,7 @@ makeFunctorArgumentParameters(argl,sigl,target) ==
-- if we find something extra, add it to the signature
null ss => s
for u in ss repeat
- $ConditionalOperators:=[CDR u,:$ConditionalOperators]
+ $ConditionalOperators:=[rest u,:$ConditionalOperators]
s is ['Join,:sl] =>
u:=ASSQ('CATEGORY,ss) =>
SUBST([:u,:ss],u,s)
@@ -539,7 +539,7 @@ compFormWithModemap1(form,m,e,modemap,Rep2Dollar?) ==
form':= [f,:[t.expr for t in Tl]]
m'=$Category or isCategoryForm(m',e) => form'
-- try to deal with new-style Unions where we know the conditions
- op = "elt" and f is ['XLAM,:.] and IDENTP(z:=CAR argl) and
+ op = "elt" and f is ['XLAM,:.] and IDENTP(z:=first argl) and
(c:=get(z,'condition,e)) and
c is [["case",=z,c1]] and
(c1 is ['_:,=(second argl),=m] or EQ(c1,second argl) ) =>
@@ -768,7 +768,7 @@ makeSimplePredicateOrNil p == nil
mkUserConstructorAbbreviation(c,a,type) ==
if $AnalyzeOnly or $convert2NewCompiler then
$abbreviationStack := [[type,a,:c],:$abbreviationStack]
- if not atom c then c:= CAR c -- Existing constructors will be wrapped
+ if not atom c then c:= first c -- Existing constructors will be wrapped
constructorAbbreviationErrorCheck(c,a,type,'abbreviationError)
clearClams()
clearConstructorCache(c)
@@ -956,10 +956,10 @@ compRepeatOrCollect(form,m,e) ==
form':= [repeatOrCollect,:itl',body']
m'':=
repeatOrCollect="COLLECT" =>
- (u:=modeIsAggregateOf('List,targetMode,e)) => CAR u
+ (u:=modeIsAggregateOf('List,targetMode,e)) => first u
["List",m']
repeatOrCollect="COLLECTV" =>
- (u:=modeIsAggregateOf('Vector,targetMode,e)) => CAR u
+ (u:=modeIsAggregateOf('Vector,targetMode,e)) => first u
["Vector",m']
m'
--------> new <--------------
@@ -1037,8 +1037,8 @@ doItIf(item is [.,p,x,y],$predl,$e) ==
oldFLP':=oldFLP
n:=0
while oldFLP' repeat
- oldFLP':=CDR oldFLP'
- flp1:=CDR flp1
+ oldFLP':=rest oldFLP'
+ flp1:=rest flp1
n:=n+1
-- Now we have to add code to compile all the elements
-- of functorLocalParameters that were added during the
@@ -1162,13 +1162,13 @@ wiReplaceNode(node,ocode,key) ==
chk(node, key + 1)
replaceNodeInStructureBy(node, x) ==
- $nodeCopy: local := [CAR node,:CDR node]
+ $nodeCopy: local := [first node,:rest node]
replaceNodeBy(node, x)
node
replaceNodeBy(node, x) ==
atom x => nil
- for y in tails x | EQCAR(x,node) repeat RPLAC(CAR x, $nodeCopy)
+ for y in tails x | EQCAR(x,node) repeat RPLAC(first x, $nodeCopy)
nil
chk(x,key) == fn(x,0,key) where fn(x,cnt,key) ==
diff --git a/src/interp/word.boot b/src/interp/word.boot
index 93570f76..3e299010 100644
--- a/src/interp/word.boot
+++ b/src/interp/word.boot
@@ -47,7 +47,7 @@ buildWordTable u ==
for key in HKEYS table repeat
HPUT(table,key,
listSort(function GLESSEQP,removeDupOrderedAlist
- listSort(function GLESSEQP, HGET(table,key),function CAR),
+ listSort(function GLESSEQP, HGET(table,key),function first),
function second))
table