aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-05-09 05:18:19 +0000
committerdos-reis <gdr@axiomatics.org>2010-05-09 05:18:19 +0000
commitae1c8a6b70153b86b7ff1ec972ba5f7ce7e818f6 (patch)
treef0be83bb14b921031429fe3e37c7b5cff93d872c
parent114fbbb2d4a1b9aca26064d8a2fcf180c65911d2 (diff)
downloadopen-axiom-ae1c8a6b70153b86b7ff1ec972ba5f7ce7e818f6.tar.gz
* interp/cattable.boot: Replace call to CONS with bracket syntax.
* interp/clammed.boot: Likewise. * interp/cparse.boot: Likewise. * interp/dq.boot: Likewise. * interp/fortcall.boot: Likewise. * interp/g-boot.boot: Likewise. * interp/i-coerce.boot: Likewise. * interp/i-coerfn.boot: Likewise. * interp/i-funsel.boot: Likewise. * interp/i-object.boot: Likewise. * interp/i-output.boot: Likewise. * interp/i-resolv.boot: Likewise. * interp/i-spec1.boot: Likewise. * interp/i-spec2.boot: Likewise. * interp/i-syscmd.boot: Likewise. * interp/incl.boot: Likewise. * interp/interop.boot: Likewise. * interp/lisplib.boot: Likewise. * interp/msgdb.boot: Likewise. * interp/newfort.boot: Likewise. * interp/nruncomp.boot: Likewise. * interp/nrunopt.boot: Likewise. * interp/rulesets.boot: Likewise. * interp/scan.boot: Likewise. * interp/termrw.boot: Likewise. * interp/wi2.boot: Likewise.
-rw-r--r--src/ChangeLog31
-rw-r--r--src/interp/cattable.boot8
-rw-r--r--src/interp/clammed.boot4
-rw-r--r--src/interp/cparse.boot5
-rw-r--r--src/interp/dq.boot4
-rw-r--r--src/interp/fortcall.boot10
-rw-r--r--src/interp/g-boot.boot40
-rw-r--r--src/interp/i-coerce.boot6
-rw-r--r--src/interp/i-coerfn.boot8
-rw-r--r--src/interp/i-funsel.boot42
-rw-r--r--src/interp/i-object.boot8
-rw-r--r--src/interp/i-output.boot24
-rw-r--r--src/interp/i-resolv.boot18
-rw-r--r--src/interp/i-spec1.boot4
-rw-r--r--src/interp/i-spec2.boot4
-rw-r--r--src/interp/i-syscmd.boot48
-rw-r--r--src/interp/incl.boot4
-rw-r--r--src/interp/interop.boot18
-rw-r--r--src/interp/lisplib.boot2
-rw-r--r--src/interp/msgdb.boot6
-rw-r--r--src/interp/newfort.boot4
-rw-r--r--src/interp/nruncomp.boot2
-rw-r--r--src/interp/nrunopt.boot2
-rw-r--r--src/interp/rulesets.boot16
-rw-r--r--src/interp/scan.boot2
-rw-r--r--src/interp/termrw.boot22
-rw-r--r--src/interp/wi2.boot2
27 files changed, 188 insertions, 156 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index eddba79e..37936b26 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,33 @@
-2010-05-08 Gabriel Dos Reis <gdr@cse.tamu.edu>
+2010-05-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/cattable.boot: Replace call to CONS with bracket syntax.
+ * interp/clammed.boot: Likewise.
+ * interp/cparse.boot: Likewise.
+ * interp/dq.boot: Likewise.
+ * interp/fortcall.boot: Likewise.
+ * interp/g-boot.boot: Likewise.
+ * interp/i-coerce.boot: Likewise.
+ * interp/i-coerfn.boot: Likewise.
+ * interp/i-funsel.boot: Likewise.
+ * interp/i-object.boot: Likewise.
+ * interp/i-output.boot: Likewise.
+ * interp/i-resolv.boot: Likewise.
+ * interp/i-spec1.boot: Likewise.
+ * interp/i-spec2.boot: Likewise.
+ * interp/i-syscmd.boot: Likewise.
+ * interp/incl.boot: Likewise.
+ * interp/interop.boot: Likewise.
+ * interp/lisplib.boot: Likewise.
+ * interp/msgdb.boot: Likewise.
+ * interp/newfort.boot: Likewise.
+ * interp/nruncomp.boot: Likewise.
+ * interp/nrunopt.boot: Likewise.
+ * interp/rulesets.boot: Likewise.
+ * interp/scan.boot: Likewise.
+ * interp/termrw.boot: Likewise.
+ * interp/wi2.boot: Likewise.
+
+2010-05-08 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/cparse.boot: Replace call to cons with bracket syntax.
* interp/cstream.boot: Likewise.
diff --git a/src/interp/cattable.boot b/src/interp/cattable.boot
index b55d6b62..939442d8 100644
--- a/src/interp/cattable.boot
+++ b/src/interp/cattable.boot
@@ -350,7 +350,7 @@ getConstrCat(x) ==
for y in x repeat
y is ['CATEGORY,.,:z] =>
for zz in z repeat cats := makeCatPred(zz, cats, true)
- cats:= CONS(y,cats)
+ cats:= [y,:cats]
cats:= nreverse cats
cats
@@ -361,7 +361,7 @@ makeCatPred(zz, cats, thePred) ==
for at in ats repeat
if at is ['ATTRIBUTE,z3] and not atom z3 and
constructor? first z3 then
- cats:= CONS(['IF,quickAnd(["has",z1,z2], thePred),z3,'%noBranch],cats)
+ cats:= [['IF,quickAnd(["has",z1,z2], thePred),z3,'%noBranch],:cats]
at is ['IF, pred, :.] =>
cats := makeCatPred(at, cats, curPred)
cats
@@ -442,14 +442,14 @@ squeeze1(l) ==
y:=
atom x => x
z:= member(x,$found) => first z
- $found:= CONS(x,$found)
+ $found:= [x,:$found]
squeeze1 x
l.first := y
x:= rest l
y:=
atom x => x
z:= member(x,$found) => first z
- $found:= CONS(x,$found)
+ $found:= [x,:$found]
squeeze1 x
l.rest := y
diff --git a/src/interp/clammed.boot b/src/interp/clammed.boot
index a1798e3a..5462d0ee 100644
--- a/src/interp/clammed.boot
+++ b/src/interp/clammed.boot
@@ -96,7 +96,7 @@ isValidType form ==
sayKeyedMsg("S2IR0005",[form])
NIL
- badDoubles := CONS($QuotientField, '(Gaussian Complex Polynomial Expression))
+ badDoubles := [$QuotientField,:'(Gaussian Complex Polynomial Expression)]
form is [T1, [T2, :.]] and T1 = T2 and member(T1, badDoubles) => NIL
form is [=$QuotientField,D] and not isPartialMode(D) and
@@ -166,7 +166,7 @@ isLegitimateMode(t,hasPolyMode,polyVarList) ==
string? t => true
atom t => false
- badDoubles := CONS($QuotientField, '(Gaussian Complex Polynomial Expression))
+ badDoubles := [$QuotientField,:'(Gaussian Complex Polynomial Expression)]
t is [T1, [T2, :.]] and T1 = T2 and member(T1, badDoubles) => false
t is [=$QuotientField,D] and not isPartialMode(D) and
diff --git a/src/interp/cparse.boot b/src/interp/cparse.boot
index 8de2a2de..6c3c1ec4 100644
--- a/src/interp/cparse.boot
+++ b/src/interp/cparse.boot
@@ -97,12 +97,13 @@ npRestore(x)==
$stack:=rest x
true
-npPush x==$stack:=CONS(x,$stack)
+npPush x==
+ $stack := [x,:$stack]
npPushId()==
a:=GETL($ttok,'INFGENERIC)
$ttok:= if a then a else $ttok
- $stack:=CONS(tokConstruct("id",$ttok,tokPosn $stok),$stack)
+ $stack := [tokConstruct("id",$ttok,tokPosn $stok),:$stack]
npNext()
npPop1()==
diff --git a/src/interp/dq.boot b/src/interp/dq.boot
index 103b9b54..0735d26b 100644
--- a/src/interp/dq.boot
+++ b/src/interp/dq.boot
@@ -47,7 +47,9 @@ namespace BOOT
-- dqToList transforms a dq to a list
-dqUnit s==(a:=[s];CONS(a,a))
+dqUnit s==
+ a := [s]
+ [a,:a]
dqUnitCopy s== dqUnit(CAAR s)
diff --git a/src/interp/fortcall.boot b/src/interp/fortcall.boot
index 7c4ba4e4..8eb93631 100644
--- a/src/interp/fortcall.boot
+++ b/src/interp/fortcall.boot
@@ -420,7 +420,7 @@ invokeFortran(objFile,args,dummies,decls,results,actual) ==
-- -- cons cell, otherwise a vector. This is to match the internal
-- -- representation of an Axiom Record.
-- #returnedValues = 1 => returnedValues
--- #returnedValues = 2 => CONS(first returnedValues,SECOND returnedValues)
+-- #returnedValues = 2 => [first returnedValues,:SECOND returnedValues]
-- makeVector(returnedValues,nil)
int2Bool u ==
@@ -431,7 +431,7 @@ int2Bool u ==
makeResultRecord(name,type,value) ==
-- Take an object returned by the NAG routine and make it into an AXIOM
-- object of type Record(key:Symbol,entry:Any) for use by Result.
- CONS(name,CONS(spadTypeTTT type,value))
+ [name,:[spadTypeTTT type,:value]]
spadify(l,results,decls,names,actual) ==
-- The elements of list l are the output forms returned from the Fortran
@@ -449,20 +449,20 @@ spadify(l,results,decls,names,actual) ==
-- Result is a Complex Scalar
ty in ["double complex" , "complex"] =>
spadForms := [makeResultRecord(name,ty, _
- CONS(ELT(fort,0),ELT(fort,1)) ),:spadForms]
+ [ELT(fort,0),:ELT(fort,1)]),:spadForms]
-- Result is a Complex vector or array
LISTP(ty) and first(ty) in ["double complex" , "complex"] =>
dims := [getVal(u,names,actual) for u in rest ty]
els := nil
if #dims=1 then
- els := [makeVector([CONS(ELT(fort,2*i),ELT(fort,2*i+1)) _
+ els := [makeVector([[ELT(fort,2*i),:ELT(fort,2*i+1)] _
for i in 0..(first(dims)-1)],nil)]
else if #dims=2 then
for r in 0..(first(dims) - 1) repeat
innerEls := nil
for c in 0..(SECOND(dims) - 1) repeat
offset := 2*(c*first(dims)+r)
- innerEls := [CONS(ELT(fort,offset),ELT(fort,offset+1)),:innerEls]
+ innerEls := [[ELT(fort,offset),:ELT(fort,offset+1)],:innerEls]
els := [makeVector(nreverse innerEls,nil),:els]
else
error ['"Can't cope with complex output dimensions higher than 2"]
diff --git a/src/interp/g-boot.boot b/src/interp/g-boot.boot
index 7b776706..f7e81cf1 100644
--- a/src/interp/g-boot.boot
+++ b/src/interp/g-boot.boot
@@ -111,18 +111,18 @@ removeEXITFromCOND c ==
-- c is '(COND ...)
z := NIL
for cl in rest c repeat
- atom cl => z := CONS(cl,z)
+ atom cl => z := [cl,:z]
cond := QCAR cl
length1? cl =>
- cond is ["EXIT",:.] => z := CONS(QCDR cond,z)
- z := CONS(cl,z)
+ cond is ["EXIT",:.] => z := [QCDR cond,:z]
+ z := [cl,:z]
cl' := reverse cl
lastSE := QCAR cl'
- atom lastSE => z := CONS(cl,z)
+ atom lastSE => z := [cl,:z]
lastSE is ["EXIT",:.] =>
- z := CONS(reverse CONS(second lastSE,rest cl'),z)
- z := CONS(cl,z)
- CONS('COND,nreverse z)
+ z := [reverse [second lastSE,:rest cl'],:z]
+ z := [cl,:z]
+ ['COND,:nreverse z]
flattenCOND body ==
-- transforms nested COND clauses to flat ones, if possible
@@ -156,15 +156,15 @@ bootCOND c ==
for cl in icls repeat
[p,:r] := cl
ncls :=
- r is [['PROGN,:r1]] => CONS([p,:r1],ncls)
- CONS(cl,ncls)
+ r is [['PROGN,:r1]] => [[p,:r1],:ncls]
+ [cl,:ncls]
fcls := bootPushEXITintoCONDclause fcls
ncls :=
fcls is [''T,['COND,:mcls]] =>
append(reverse mcls,ncls)
fcls is [''T,['PROGN,:mcls]] =>
- CONS([''T,:mcls],ncls)
- CONS(fcls,ncls)
+ [[''T,:mcls],:ncls]
+ [fcls,:ncls]
['COND,:reverse ncls]
bootPushEXITintoCONDclause e ==
@@ -173,9 +173,9 @@ bootPushEXITintoCONDclause e ==
for cl in cls repeat
[p,:r] := cl
ncls :=
- r is [['EXIT,:.]] => CONS(cl,ncls)
- r is [r1] => CONS([p,['EXIT,r1]],ncls)
- CONS([p,['EXIT,bootTran ['PROGN,:r]]],ncls)
+ r is [['EXIT,:.]] => [cl,:ncls]
+ r is [r1] => [[p,['EXIT,r1]],:ncls]
+ [[p,['EXIT,bootTran ['PROGN,:r]]],:ncls]
[''T,['COND,:nreverse ncls]]
--% SEQ and PROGN
@@ -258,7 +258,7 @@ defLET1(lhs,rhs) ==
rhs' := defLET2(lhs,rhs)
EQCAR(rhs',$LET) => MKPROGN [rhs',rhs]
rhs' is ["PROGN",:.] => append(rhs',[rhs])
- if IDENTP first rhs' then rhs' := CONS(rhs',NIL)
+ if IDENTP first rhs' then rhs' := [rhs',:NIL]
MKPROGN [:rhs',rhs]
rhs is [=$LET,:.] and IDENTP(name := second rhs) =>
-- handle things like [a] := x := foo
@@ -272,7 +272,7 @@ defLET1(lhs,rhs) ==
rhs' := [$LET,g,rhs]
let' := defLET1(lhs,g)
let' is ["PROGN",:.] => MKPROGN [rhs',:rest let']
- if IDENTP first let' then let' := CONS(let',NIL)
+ if IDENTP first let' then let' := [let',:NIL]
MKPROGN [rhs',:let',g]
defLET2(lhs,rhs) ==
@@ -283,7 +283,7 @@ defLET2(lhs,rhs) ==
a := defLET2(a,rhs)
null (b := defLET2(b,rhs)) => a
atom b => [a,b]
- cons? QCAR b => CONS(a,b)
+ cons? QCAR b => [a,:b]
[a,b]
lhs is ['CONS,var1,var2] =>
var1 = "." or (var1 is ["QUOTE",:.]) =>
@@ -333,8 +333,8 @@ addCARorCDR(acc,expr) ==
CAADDR CADAAR CADDAR CADADR CADDDR)
funsR := '(CDAR CDDR CDAAR CDDAR CDADR CDDDR CDAAAR CDADAR CDAADR
CDADDR CDDAAR CDDDAR CDDADR CDDDDR)
- if acc = 'CAR then CONS(funsA.p,QCDR expr)
- else CONS(funsR.p,QCDR expr)
+ if acc = 'CAR then [funsA.p,:QCDR expr]
+ else [funsR.p,:QCDR expr]
--% IS
@@ -437,7 +437,7 @@ bootLabelsForGO e ==
atom e => NIL
[head,:tail] := e
IDENTP head =>
- head = 'GO => $labelsForGO := CONS(first tail,$labelsForGO)
+ head = 'GO => $labelsForGO := [first tail,:$labelsForGO]
head = 'QUOTE => NIL
bootLabelsForGO tail
bootLabelsForGO head
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index 2acea070..c1f8ef61 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -926,10 +926,10 @@ coerceSubDomain(val, tSuper, tSub) ==
nil
getSubDomainPredicate(tSuper, tSub, pred) ==
- predfn := HGET($superHash, CONS(tSuper, tSub)) => predfn
+ predfn := HGET($superHash, [tSuper,:tSub]) => predfn
arg := GENSYM()
predfn := COMPILE(nil,["LAMBDA",[arg],substitute(arg,"#1", pred)])
- HPUT($superHash, CONS(tSuper, tSub), predfn)
+ HPUT($superHash, [tSuper,:tSub], predfn)
predfn
coerceIntX(val,t1, t2) ==
@@ -1227,7 +1227,7 @@ computeTTTranspositions(t1,t2) ==
t := tower.(first perm)
tower.(first perm) := tower.(rest perm)
tower.(rest perm) := t
- towers := CONS(VEC2LIST tower,towers)
+ towers := [VEC2LIST tower,:towers]
towers := [reassembleTowerIntoType tower for tower in towers]
if first(towers) ~= t2 then towers := [t2,:towers]
nreverse towers
diff --git a/src/interp/i-coerfn.boot b/src/interp/i-coerfn.boot
index 21473c86..adc6ca62 100644
--- a/src/interp/i-coerfn.boot
+++ b/src/interp/i-coerfn.boot
@@ -84,9 +84,9 @@ coerceDmp1(u,source is [.,v1,S],target is [.,v2,T],v,w) ==
pat3:= [member(x,v) and POSN1(x,v) for x in v2]
for [e,:c] in u until not z repeat
exp:= LIST2VEC [y for x in pat2 for y in VEC2LIST e | x]
- z:= coerceInt(objNewWrap([CONS(exp,c)],t),target) =>
+ z:= coerceInt(objNewWrap([[exp,:c]],t),target) =>
li:= [y for x in pat1 for y in VEC2LIST e | x]
- a:= [CONS(LIST2VEC [if x then li.x else 0 for x in pat3],one)]
+ a:= [[LIST2VEC [if x then li.x else 0 for x in pat3],:one]]
x:= SPADCALL(x,SPADCALL(objValUnwrap(z),a,multfunc),plusfunc)
z => x
coercionFailure()
@@ -101,7 +101,7 @@ coerceDmp2(u,source is [.,v1,S],target is [.,v2,T]) ==
for [e,:c] in u until not z repeat
z:= coerceInt(objNewWrap(c,S),target) =>
li:= VEC2LIST e
- a:= [CONS(LIST2VEC [if x then li.x else 0 for x in pat],one)]
+ a:= [[LIST2VEC [if x then li.x else 0 for x in pat],:one]]
x:= SPADCALL(x,SPADCALL(objValUnwrap(z),a,multfunc),plusfunc)
NIL
z => x
@@ -307,7 +307,7 @@ Dmp2Up(u, source is [dmp,vl,S],target is [up,var,T]) ==
c' = zero => x := REMALIST(x,exp)
p.rest := c'
zero = objValUnwrap(y) => 'iterate
- x := CONS(CONS(exp,objValUnwrap(y)),x)
+ x := [[exp,:objValUnwrap(y)],:x]
y => nreverse SORTBY('CAR,x)
coercionFailure()
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index f671ed6b..faac9233 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -639,14 +639,14 @@ orderMms(name, mmS,args1,args2,tar) ==
for mm in MSORT mmS repeat
[sig,.,cond]:= mm
b:= 'T
- p:= CONS(m := mmCost(name, sig,cond,tar,args1,args2),mm)
+ p:= [m := mmCost(name, sig,cond,tar,args1,args2),:mm]
mS:=
null mS => list p
- m < CAAR mS => CONS(p,mS)
+ m < CAAR mS => [p,:mS]
S:= mS
until b repeat
b:= null rest S or m < CAADR S =>
- S.rest := CONS(p,rest S)
+ S.rest := [p,:rest S]
S:= rest S
mS
mmS and [rest p for p in mS]
@@ -830,7 +830,7 @@ allOrMatchingMms(mms,args1,tar,dc) ==
[sig,:.] := mm
[res,:args] := MSUBSTQ(dc,"$",sig)
args ~= args1 => nil
- x := CONS(mm,x)
+ x := [mm,:x]
if x then x
else mms
@@ -852,7 +852,7 @@ findFunctionInDomain1(omm,op,tar,args1,args2,SL) ==
[sig,slot,cond,y] := mm
[osig,:.] := omm
- osig := subCopy(osig, SUBSTQ(CONS('$,'$), dollarPair, SL))
+ osig := subCopy(osig, SUBSTQ(['$,:'$], dollarPair, SL))
if CONTAINED('_#, sig) or CONTAINED('construct,sig) then
sig := [replaceSharpCalls t for t in sig]
matchMmCond cond and matchMmSig(mm,tar,args1,args2) and
@@ -863,10 +863,10 @@ findFunctionInDomain1(omm,op,tar,args1,args2,SL) ==
y := 'ELT -- if subsumed fails try it again
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]]
- y='ASCONST => [[CONS(dc,sig),osig,nreverse $RTC]]
- y is ['XLAM,:.] => [[CONS(dc,sig),y,nreverse $RTC]]
+ y='ELT => [[[dc,:sig],osig,nreverse $RTC]]
+ y='CONST => [[[dc,:sig],osig,nreverse $RTC]]
+ y='ASCONST => [[[dc,:sig],osig,nreverse $RTC]]
+ y is ['XLAM,:.] => [[[dc,:sig],y,nreverse $RTC]]
sayKeyedMsg("S2IF0006",[y])
NIL
@@ -946,7 +946,7 @@ matchMmSig(mm,tar,args1,args2) ==
$SubDom and isSubDomain(x,x1) => rtc:= 'T
$Coerce => x2=x or canCoerceFrom(x1,x)
x1 is ['Variable,:.] and x = $Symbol
- $RTC:= CONS(rtc,$RTC)
+ $RTC:= [rtc,:$RTC]
null args1 and null a and b and matchMmSigTar(tar,first sig)
matchMmSigTar(t1,t2) ==
@@ -966,9 +966,9 @@ matchMmSigTar(t1,t2) ==
constructSubst(d) ==
-- constructs a substitution which substitutes d for $
-- and the arguments of d for #1, #2 ..
- SL:= list CONS('$,d)
+ SL:= list ['$,:d]
for x in rest d for i in 1.. repeat
- SL:= CONS(CONS(INTERNL('"#",STRINGIMAGE i),x),SL)
+ SL:= [[INTERNL('"#",STRINGIMAGE i),:x],:SL]
SL
filterModemapsFromPackages(mms, names, op) ==
@@ -1096,8 +1096,8 @@ selectMmsGen(op,tar,args1,args2) ==
ok := true
for pat in a for arg in args while ok repeat
not CONTAINED(['isDomain,pat,arg],mmC) => ok := NIL
- ok => ex := CONS(mm,ex)
- inex := CONS(mm,inex)
+ ok => ex := [mm,:ex]
+ inex := [mm,:inex]
[ex,inex]
matchMms(mmaps,op,tar,args1,args2) ==
mmS := NIL
@@ -1135,8 +1135,8 @@ matchTypes(pm,args1,args2) ==
t0 := resolveTT(t,t1) => p.rest := t0
$Subst:= 'failed
$Subst:= 'failed
- $Subst:= CONS(CONS(v,t1),$Subst)
- if t1 = $Symbol and t2 then $SymbolType:= CONS(CONS(v,t2),$SymbolType)
+ $Subst:= [[v,:t1],:$Subst]
+ if t1 = $Symbol and t2 then $SymbolType:= [[v,:t2],:$SymbolType]
evalMm(op,tar,sig,mmC) ==
-- evaluates a modemap with signature sig and condition mmC
@@ -1173,7 +1173,7 @@ evalMmStack(mmC) ==
mmC is ['OR,:args] => [:evalMmStack a for a in args]
mmC is ['partial,:mmD] => evalMmStack mmD
mmC is ['ofCategory,pvar,cat] and cat is ['Join,:args] =>
- evalMmStack CONS('AND,[['ofCategory,pvar,c] for c in args])
+ evalMmStack ['AND,:[['ofCategory,pvar,c] for c in args]]
mmC is ['ofType,:.] => [NIL]
mmC is ["has",pat,x] =>
x in '(ATTRIBUTE SIGNATURE) =>
@@ -1335,7 +1335,7 @@ evalMmCat(op,sig,stack,SL) ==
for mmC in st repeat
S:= evalMmCat1(mmC,op, SL)
S='failed and $hope =>
- stack:= CONS(mmC,stack)
+ stack:= [mmC,:stack]
S = 'failed => return S
not atom S =>
makingProgress:= 'T
@@ -1366,11 +1366,11 @@ evalMmCat1(mmC is ['ofCategory,d,c],op, SL) ==
op ~= 'coerce => 'failed -- evalMmCatLastChance(d,c,SL)
null (p := ASSQ(d,$Subst)) =>
dom =>
- NSL := [CONS(d,dom)]
+ NSL := [[d,:dom]]
op ~= 'coerce => 'failed -- evalMmCatLastChance(d,c,SL)
if containsVars dom then dom := resolveTM(rest p, dom)
$Coerce and canCoerce(rest p, dom) =>
- NSL := [CONS(d,dom)]
+ NSL := [[d,:dom]]
op ~= 'coerce => 'failed -- evalMmCatLastChance(d,c,SL)
NSL
@@ -1739,7 +1739,7 @@ getSymbolType var ==
-- var is a pattern variable
p:= ASSQ(var,$SymbolType) => rest p
t:= '(Polynomial (Integer))
- $SymbolType:= CONS(CONS(var,t),$SymbolType)
+ $SymbolType:= [[var,:t],:$SymbolType]
t
isEqualOrSubDomain(d1,d2) ==
diff --git a/src/interp/i-object.boot b/src/interp/i-object.boot
index 401ed7fc..56a09579 100644
--- a/src/interp/i-object.boot
+++ b/src/interp/i-object.boot
@@ -67,8 +67,8 @@ $useIntegerSubdomain := true
-- These are the new structure functions.
-objNew(val, mode) == CONS(mode,val) -- new names as of 10/14/93
-objNewWrap(val, mode) == CONS(mode,wrap val)
+objNew(val, mode) == [mode,:val] -- new names as of 10/14/93
+objNewWrap(val, mode) == [mode,:wrap val]
objNewCode(val, mode) == ["CONS", MKQ mode,val ]
objSetVal(obj,val) == obj.rest := val
objSetMode(obj,mode) == obj.first := mode
@@ -133,10 +133,10 @@ instantiationNormalForm(op,argl) ==
-- Tuples and Crosses
asTupleNew(eltType,size,listOfElts) ==
- CONS(size, makeSimpleArrayFromList(eltType,listOfElts))
+ [size,:makeSimpleArrayFromList(eltType,listOfElts)]
asTupleNew0(eltType,listOfElts) ==
- CONS(#listOfElts, makeSimpleArrayFromList(eltType,listOfElts))
+ [#listOfElts,:makeSimpleArrayFromList(eltType,listOfElts)]
asTupleNewCode(eltType, size, listOfElts) ==
["asTupleNew", quoteForm getVMType eltType, size, ["LIST", :listOfElts]]
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index 9e145660..e96590c7 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -2097,10 +2097,10 @@ slashWidth(u) ==
longext(u, i, n) ==
x := reverse u
y := first x
- u := remWidth(REVERSEWOC(CONS('" ", rest x)))
+ u := remWidth(REVERSEWOC(['" ",:rest x]))
charybdis(u, i, n)
if not $collectOutput then TERPRI $algebraOutputStream
- charybdis(CONS('ELSE, LIST y), i, n)
+ charybdis(['ELSE, :LIST y], i, n)
'" "
appvertline(char, x, yl, yu, d) ==
@@ -2289,10 +2289,10 @@ matWidth(x) ==
CAAR x.1
matLSum(x) ==
- CONS(sumoverlist x + LENGTH x, x)
+ [sumoverlist x + LENGTH x,:x]
matLSum2(x) ==
- CONS(sumoverlist x + 2*(LENGTH x), x)
+ [sumoverlist x + 2*(LENGTH x),:x]
matWList(x, y) ==
null x => y
@@ -2300,11 +2300,11 @@ matWList(x, y) ==
matWList1(x, y) ==
null x => nil
- true => CONS(MAX(WIDTH first x, first y), matWList1(rest x, rest y) )
+ true => [MAX(WIDTH first x, first y),:matWList1(rest x, rest y)]
matSubList(x) == --computes the max/[subspan(e) for e in "row named x"]
null x => nil
- true => CONS(matSubList1(CDAR x, 0), matSubList(rest x) )
+ true => [matSubList1(CDAR x, 0),:matSubList(rest x)]
matSubList1(x, y) ==
null x => y
@@ -2312,7 +2312,7 @@ matSubList1(x, y) ==
matSuperList(x) == --computes the max/[superspan(e) for e in "row named x"]
null x => nil
- true => CONS(matSuperList1(CDAR x, 0), matSuperList(rest x) )
+ true => [matSuperList1(CDAR x, 0),:matSuperList(rest x)]
matSuperList1(x, y) ==
null x => y
@@ -2325,8 +2325,8 @@ minusWidth(u) ==
-- LASSOC(name, x) or '","
bracketagglist(u, start, linelength, tchr, open, close) ==
- u := CONS(LIST('CONCAT, open, first u),
- [LIST('CONCAT, '" ", y) for y in rest u] )
+ u := [LIST('CONCAT, open, first u),
+ :[LIST('CONCAT, '" ", y) for y in rest u]]
repeat
s := 0
for x in tails u repeat
@@ -2340,7 +2340,7 @@ bracketagglist(u, start, linelength, tchr, open, close) ==
for x in tails u repeat
x.first := LIST('CONCAT, first x, tchr)
if null nextu then LAST(u).rest.rest.first := close
- x := ASSOCIATER('CONCAT, CONS(ichr, u))
+ x := ASSOCIATER('CONCAT, [ichr,:u])
charybdis(ASSOCIATER('CONCAT, u), start, linelength)
if $collectOutput then TERPRI $algebraOutputStream
ichr := '" "
@@ -2370,8 +2370,8 @@ qTWidth(u) ==
remWidth(x) ==
atom x => x
- true => CONS( (atom first x => first x; true => CAAR x),
- MMAPCAR(function remWidth, rest x) )
+ true => [(atom first x => first x; true => CAAR x),
+ :MMAPCAR(function remWidth, rest x)]
subSub(u) ==
height CDDR u
diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot
index 78c61f88..0af2a733 100644
--- a/src/interp/i-resolv.boot
+++ b/src/interp/i-resolv.boot
@@ -278,7 +278,7 @@ resolveTTEq1(c1,arg1,TL is [c2,arg2,:.]) ==
[c2,arg2,:TL] := bubbleType TL
until null arg1 or null arg2 or not t repeat
t := resolveTT1(first arg1,first arg2) =>
- arg := CONS(t,arg)
+ arg := [t,:arg]
arg1 := rest arg1
arg2 := rest arg2
t and null arg1 and null arg2 and
@@ -423,7 +423,7 @@ getConditionalCategoryOfType1(cat,conditions,match,seen) ==
match,seen)
cat is ['IF,., cond,.] =>
matchUpToPatternVars(cond,match,NIL) =>
- conditions.rest := CONS(cat,rest conditions)
+ conditions.rest := [cat,:rest conditions]
conditions
conditions
cat is [catName,:.] and (getConstructorKindFromDB catName = "category") =>
@@ -489,7 +489,7 @@ resolveTM1(t,m) ==
tt := resolveTT1(t,rest p) => (p.rest := tt) and tt
NIL
t=rest p and t
- $Subst := CONS(CONS(m,t),$Subst)
+ $Subst := [[m,:t],:$Subst]
t
atom(t) or atom(m) => NIL
(t is ['Record,:tr]) and (m is ['Record,:mr]) and
@@ -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([first ta,second ta,ra],tt)
+ tt := [[first ta,second ta,ra],:tt]
null ok => NIL
['Record,nreverse tt]
@@ -655,7 +655,7 @@ resolveTMEq2(cm,argm,TL) ==
x2 := first argm
argm := rest argm
tt := resolveTM1(x1,x2) =>
- arg := CONS(tt,arg)
+ arg := [tt,:arg]
null argt and null argm and tt and constructM(ct,nreverse arg)
resolveTMRed(t,m) ==
@@ -723,8 +723,8 @@ getUnderModeOf d ==
-- 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)
--- CONS(t,NIL)
+-- [c,:args]
+-- [t,:NIL]
deconstructT(t) ==
-- M is a type, which may contain type variables
@@ -733,8 +733,8 @@ deconstructT(t) ==
dt := destructT op
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)
- CONS(t,NIL)
+ [c,:args]
+ [t,:NIL]
constructT(c,A) ==
-- c is a type constructor, A a list of argument types
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index d72fb7f1..371d2fc2 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -1185,11 +1185,11 @@ replaceSharps(x,d) ==
-- all replaces the triangle variables
SL:= NIL
for e in rest d for var in $FormalMapVariableList repeat
- SL:= CONS(CONS(var,e),SL)
+ SL:= [[var,:e],:SL]
x := subCopy(x,SL)
SL:= NIL
for e in rest d for var in $TriangleVariableList repeat
- SL:= CONS(CONS(var,e),SL)
+ SL:= [[var,:e],:SL]
subCopy(x,SL)
isDomainValuedVariable form ==
diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot
index c9b691b7..8a8a955e 100644
--- a/src/interp/i-spec2.boot
+++ b/src/interp/i-spec2.boot
@@ -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,rest sv)
+ (sv := assoc(name,$InterpreterMacroAlist)) => [NIL,:rest sv]
NIL
--% Handlers for prefix QUOTE
@@ -1175,7 +1175,7 @@ copyHack(env) ==
-- (localModemap . something)
c:= CAAR env
d:= [fn p for p in c] where fn(p) ==
- CONS(first p,[(q is ["localModemap",:.] => q; copy q) for q in rest p])
+ [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 8092c467..55a507cf 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -99,7 +99,7 @@ initializeSystemCommands() ==
l := $systemCommands
$SYSCOMMANDS := NIL
while l repeat
- $SYSCOMMANDS := CONS(CAAR l, $SYSCOMMANDS)
+ $SYSCOMMANDS := [CAAR l,:$SYSCOMMANDS]
l := rest l
$SYSCOMMANDS := nreverse $SYSCOMMANDS
@@ -1134,9 +1134,9 @@ interpFunctionDepAlists() ==
$dependeeAlist := [[NIL,:NIL]]
for [dependee,dependent] in deps repeat
$dependentAlist := PUTALIST($dependentAlist,dependee,
- CONS(dependent,GETALIST($dependentAlist,dependee)))
+ [dependent,:GETALIST($dependentAlist,dependee)])
$dependeeAlist := PUTALIST($dependeeAlist,dependent,
- CONS(dependee,GETALIST($dependeeAlist,dependent)))
+ [dependee,:GETALIST($dependeeAlist,dependent)])
fixObjectForPrinting(v) ==
v' := object2Identifier v
@@ -1396,8 +1396,8 @@ addNewInterpreterFrame(name) ==
for f in $interpreterFrameRing repeat
name = frameName(f) => throwKeyedMsg("S2IZ0019",[name])
initHistList()
- $interpreterFrameRing := CONS(emptyInterpreterFrame(name),
- $interpreterFrameRing)
+ $interpreterFrameRing := [emptyInterpreterFrame(name),
+ :$interpreterFrameRing]
updateFromCurrentInterpreterFrame()
_$ERASE histFileName()
@@ -1425,7 +1425,7 @@ closeInterpreterFrame(name) ==
found := nil
ifr := NIL
for f in $interpreterFrameRing repeat
- found or (name ~= frameName(f)) => ifr := CONS(f,ifr)
+ found or (name ~= frameName(f)) => ifr := [f,:ifr]
found := true
not found => throwKeyedMsg("S2IZ0022",[name])
_$ERASE makeHistFileName(name)
@@ -1600,7 +1600,7 @@ initHistList() ==
$HistListLen:= 20
$HistList:= LIST NIL
li:= $HistList
- for i in 1..$HistListLen repeat li:= CONS(NIL,li)
+ for i in 1..$HistListLen repeat li:= [NIL,:li]
$HistList.rest := li
$HistListAct:= 0
$HistRecord:= NIL
@@ -1658,7 +1658,7 @@ setHistoryCore inCore ==
l := LENGTH RKEYIDS histFileName()
for i in 1..l repeat
vec:= UNWIND_-PROTECT(readHiFi(i),disableHist())
- $internalHistoryTable := CONS([i,:vec],$internalHistoryTable)
+ $internalHistoryTable := [[i,:vec],:$internalHistoryTable]
histFileErase histFileName()
$useInternalHistoryTable := true
sayKeyedMsg("S2IH0032",NIL)
@@ -1724,7 +1724,7 @@ changeHistListLen(n) ==
$HistListLen:= n
l:= rest $HistList
if dif > 0 then
- for i in 1..dif repeat l:= CONS(NIL,l)
+ for i in 1..dif repeat l:= [NIL,:l]
if dif < 0 then
for i in 1..-dif repeat l:= rest l
if $HistListAct > n then $HistListAct:= n
@@ -1774,9 +1774,9 @@ recordNewValue0(x,prop,val) ==
p1:= ASSQ(x,$HistRecord) =>
p2:= ASSQ(prop,rest p1) =>
p2.rest := val
- p1.rest := CONS(CONS(prop,val),rest p1)
- p:= CONS(x,list CONS(prop,val))
- $HistRecord:= CONS(p,$HistRecord)
+ p1.rest := [[prop,:val],:rest p1]
+ p:= [x,:list [prop,:val]]
+ $HistRecord:= [p,:$HistRecord]
recordOldValue(x,prop,val) ==
startTimingProcess 'history
@@ -1787,9 +1787,9 @@ recordOldValue0(x,prop,val) ==
-- writes (prop . val) into $HistList
p1:= ASSQ(x,first $HistList) =>
not ASSQ(prop,rest p1) =>
- p1.rest := CONS(CONS(prop,val),rest p1)
- p:= CONS(x,list CONS(prop,val))
- $HistList.first := CONS(p,first $HistList)
+ p1.rest := [[prop,:val],:rest p1]
+ p:= [x,:list [prop,:val]]
+ $HistList.first := [p,:first $HistList]
undoInCore(n) ==
-- undoes the last n>0 steps using $HistList
@@ -1883,7 +1883,7 @@ restoreHistory(fn) ==
for i in 1..l repeat
vec:= UNWIND_-PROTECT(readHiFi(i),disableHist())
if oldInternal then $internalHistoryTable :=
- CONS([i,:vec],$internalHistoryTable)
+ [[i,:vec],:$internalHistoryTable]
LINE:= first vec
for p1 in rest vec repeat
x:= first p1
@@ -2001,11 +2001,11 @@ writeHiFi() ==
-- writes the information of the current step out to history file
if $useInternalHistoryTable
then
- $internalHistoryTable := CONS([$IOindex,$currentLine,:$HistRecord],
- $internalHistoryTable)
+ $internalHistoryTable := [[$IOindex,$currentLine,:$HistRecord],
+ :$internalHistoryTable]
else
HiFi:= RDEFIOSTREAM ['(MODE . OUTPUT),['FILE,:histFileName()]]
- SPADRWRITE(object2Identifier $IOindex, CONS($currentLine,$HistRecord),HiFi)
+ SPADRWRITE(object2Identifier $IOindex, [$currentLine,:$HistRecord],HiFi)
RSHUT HiFi
disableHist() ==
@@ -2065,7 +2065,7 @@ writify ob ==
nob
(ob is ['LAMBDA_-CLOSURE, ., ., x, :.]) and x =>
THROW('writifyTag, 'writifyFailed)
- nob := CONS(qcar, qcdr)
+ nob := [qcar,:qcdr]
HPUT($seen, ob, nob)
HPUT($seen, nob, nob)
qcar := writifyInner qcar
@@ -2193,7 +2193,7 @@ dewritify ob ==
name := ob.3
not FBOUNDP name =>
error STRCONC('"undefined function: ", SYMBOL_-NAME name)
- nob := CONS(SYMBOL_-FUNCTION name, vec)
+ nob := [SYMBOL_-FUNCTION name,:vec]
HPUT($seen, ob, nob)
HPUT($seen, nob, nob)
nob
@@ -2216,7 +2216,7 @@ dewritify ob ==
cons? ob =>
qcar := QCAR ob
qcdr := QCDR ob
- nob := CONS(qcar, qcdr)
+ nob := [qcar,:qcdr]
HPUT($seen, ob, nob)
HPUT($seen, nob, nob)
nob.first := dewritifyInner qcar
@@ -2677,7 +2677,7 @@ recordFrame(systemNormal) ==
delta := ['systemCommand,:delta]
$frameRecord := [delta,:$frameRecord]
$previousBindings := --copy all but the individual properties
- [CONS(first x,[CONS(first y,rest y) for y in rest x]) for x in CAAR $InteractiveFrame]
+ [[first x,:[[first y,:rest y] for y in rest x]] for x in CAAR $InteractiveFrame]
first $frameRecord
diffAlist(new,old) ==
@@ -2896,7 +2896,7 @@ filterAndFormatConstructors(constrType,label,patterns) ==
whatConstructors constrType ==
-- here constrType should be one of 'category, 'domain, 'package
- MSORT [CONS(getConstructorAbbreviationFromDB con, STRING(con))
+ MSORT [[getConstructorAbbreviationFromDB con, :STRING(con)]
for con in allConstructors()
| getConstructorKindFromDB con = constrType]
diff --git a/src/interp/incl.boot b/src/interp/incl.boot
index f59e76ac..ebd71c2e 100644
--- a/src/interp/incl.boot
+++ b/src/interp/incl.boot
@@ -76,7 +76,7 @@ incConsoleInput () == incRgen MAKE_-INSTREAM 0
incLine(eb, str, gno, lno, ufo) ==
ln := lnCreate(eb,str,gno,lno,ufo)
- CONS(CONS(ln,1), str)
+ [[ln,:1],:str]
incPos f == first f
@@ -196,7 +196,7 @@ xlOK1(eb, str,str1, lno, ufo) ==
incLine1(eb, str,str1, gno, lno, ufo) ==
ln := lnCreate(eb,str,gno,lno,ufo)
- CONS(CONS(ln,1), str1)
+ [[ln,:1],:str1]
xlSkip(eb, str, lno, ufo) ==
str := CONCAT('"-- Omitting:", str)
[incLine(eb, str, -1, lno, ufo), [NIL, "none"]]
diff --git a/src/interp/interop.boot b/src/interp/interop.boot
index b48cd2c5..bf0e614b 100644
--- a/src/interp/interop.boot
+++ b/src/interp/interop.boot
@@ -71,13 +71,13 @@ DNameToSExpr1 dname ==
froms := MAPCAR(function DNameToSExpr, rest froms)
ret := second args -- a tuple
ret := DNameToSExpr second ret -- contents
- CONS('Mapping, CONS(ret, froms))
+ ['Mapping,:[ret,:froms]]
name0 = 'Union or name0 = 'Record =>
sxs := MAPCAR(function DNameToSExpr, rest first args)
- CONS(name0, sxs)
+ [name0,:sxs]
name0 = 'Enumeration =>
- CONS(name0, MAPCAR(function DNameFixEnum, rest first args))
- CONS(name0, MAPCAR(function DNameToSExpr, args))
+ [name0,:MAPCAR(function DNameFixEnum, rest first args)]
+ [name0,:MAPCAR(function DNameToSExpr, args)]
DNameToSExpr dname ==
first dname = DNameOtherID =>
@@ -148,7 +148,7 @@ lazyOldAxiomDomainDevaluate(domenv, env) ==
SPADCALL(rest dom, first dom.1)
lazyOldAxiomAddChild(domenv, kid, env) ==
- CONS($lazyOldAxiomDomainDispatch,domenv)
+ [$lazyOldAxiomDomainDispatch,:domenv]
$lazyOldAxiomDomainDispatch :=
VECTOR('lazyOldAxiomDomain,
@@ -163,8 +163,8 @@ $lazyOldAxiomDomainDispatch :=
-- old Axiom category objects are (dispatch . [catform, hashcode, defaulting package, parent vector, dom])
oldAxiomPreCategoryBuild(catform, dom, env) ==
pack := oldAxiomCategoryDefaultPackage(catform, dom)
- CONS($oldAxiomCategoryDispatch,
- [catform, hashTypeForm(catform,0), pack, oldAxiomPreCategoryParents(catform,dom), dom])
+ [$oldAxiomCategoryDispatch,
+ :[catform, hashTypeForm(catform,0), pack, oldAxiomPreCategoryParents(catform,dom), dom]]
oldAxiomPreCategoryHashCode(catform, env) == hashTypeForm(catform,0)
oldAxiomCategoryDefaultPackage(catform, dom) ==
hasDefaultPackage opOf catform
@@ -203,7 +203,7 @@ oldAxiomCategoryLookupExport(catenv, self, op, sig, box, env) ==
opIsHasCat op => if EQL(sig, hash) then [self] else nil
null(pack) => nil
if not VECP pack then
- pack:=apply(pack, CONS(self, rest catform))
+ pack:=apply(pack, [self, :rest catform])
catenv.rest.rest.first := pack
fun := basicLookup(op, sig, pack, self) => [fun]
nil
@@ -330,7 +330,7 @@ oldAxiomDomainHasCategory(domenv, cat, env) ==
oldAxiomDomainDevaluate(domenv, env) ==
SExprToDName(rest domenv.0, 'T)
-oldAxiomAddChild(domenv, child, env) == CONS($oldAxiomDomainDispatch, domenv)
+oldAxiomAddChild(domenv, child, env) == [$oldAxiomDomainDispatch,:domenv]
$oldAxiomDomainDispatch :=
VECTOR('oldAxiomDomain,
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index 9e7530a5..fe967093 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 rest sig])
+ [NIL,:[categoryForm?(x) for x in rest sig]]
NIL
-- in following, add property value false or NIL to possibly clear
-- old value
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index f3da9595..de7c61ea 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -130,7 +130,7 @@ segmentedMsgPreprocess x ==
while tail and ok repeat
[t,:tail] := tail
member(t, '(%ceoff "%ceoff" %rjoff "%rjoff")) => ok := NIL
- y := CONS(segmentedMsgPreprocess t,y)
+ y := [segmentedMsgPreprocess t,:y]
head1 := [(center => '"%ce"; '"%rj"),:nreverse y]
null tail => [head1]
[head1,:segmentedMsgPreprocess tail]
@@ -779,7 +779,7 @@ brightPrintCenter(x,out == $OutputStream) ==
wid := sayBrightlyLength y
if wid < $LINELENGTH then
f := DIVIDE($LINELENGTH - wid,2)
- y := CONS(fillerSpaces(f.0,'" "),y)
+ y := [fillerSpaces(f.0,'" "),:y]
for z in y repeat brightPrint0(z,out)
if x then
sayNewLine(out)
@@ -825,7 +825,7 @@ brightPrintRightJustify(x, out == $OutputStream) ==
y := nreverse y
wid := sayBrightlyLength y
if wid < $LINELENGTH then
- y := CONS(fillerSpaces($LINELENGTH-wid,'" "),y)
+ y := [fillerSpaces($LINELENGTH-wid,'" "),:y]
for z in y repeat brightPrint0(z,out)
if x then
sayNewLine(out)
diff --git a/src/interp/newfort.boot b/src/interp/newfort.boot
index f7b567b4..b07b0107 100644
--- a/src/interp/newfort.boot
+++ b/src/interp/newfort.boot
@@ -704,8 +704,8 @@ fortFormatTypes1(typeName,names) ==
insertEntry(size,el,aList) ==
entry := assoc(size,aList)
- null entry => CONS(CONS(size,LIST el),aList)
- entry.rest := CONS(el,rest entry)
+ null entry => [[size,:LIST el],:aList]
+ entry.rest := [el,:rest entry]
aList
fortFormatCharacterTypes(names) ==
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot
index fdcbcd86..7c5f4fb6 100644
--- a/src/interp/nruncomp.boot
+++ b/src/interp/nruncomp.boot
@@ -611,7 +611,7 @@ NRTsetVector4Part2(uncondList,condList) ==
mergeAppend(l1,l2) ==
atom l1 => l2
member(QCAR l1,l2) => mergeAppend(QCDR l1, l2)
- CONS(QCAR l1, mergeAppend(QCDR l1, l2))
+ [QCAR l1, :mergeAppend(QCDR l1, l2)]
catList2catPackageList u ==
--converts ((Set) (Module R) ...) to ((Set& $) (Module& $ R)...)
diff --git a/src/interp/nrunopt.boot b/src/interp/nrunopt.boot
index 8c3df67a..19ba1f83 100644
--- a/src/interp/nrunopt.boot
+++ b/src/interp/nrunopt.boot
@@ -362,7 +362,7 @@ NRTmakeCategoryAlist() ==
sixEtc := [5 + i for i in 1..#$pairlis]
formals := ASSOCRIGHT $pairlis
for x in slot1 repeat
- x.first := EQSUBSTLIST(CONS("$$",sixEtc),CONS('$,formals),first x)
+ x.first := EQSUBSTLIST(["$$",:sixEtc],['$,:formals],first x)
-----------code to make a new style slot4 -----------------
predList := ASSOCRIGHT slot1 --is list of predicate indices
maxPredList := "MAX"/predList
diff --git a/src/interp/rulesets.boot b/src/interp/rulesets.boot
index a2a05ed5..d877008d 100644
--- a/src/interp/rulesets.boot
+++ b/src/interp/rulesets.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2008, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -148,8 +148,8 @@ createResolveTTRules() ==
-- expand multivariate polynomial rules
mps := '(MP DMP NDMP)
mpRules := "append"/[substitute(mp,'mpoly1,$mpolyTTRules) for mp in mps]
- $Res := CONS('(t1 t2 x y),
- EQSUBSTLIST($nameList,$abList,append($generalTTRules,mpRules)))
+ $Res := ['(t1 t2 x y),
+ :EQSUBSTLIST($nameList,$abList,append($generalTTRules,mpRules))]
true
--% resolveTM Rules
@@ -285,17 +285,17 @@ createResolveTMRules() ==
mps := '(MP DMP NDMP)
mpRules0 := "append"/[substitute(mp,'mpoly1,$mpolyTMRules) for mp in mps]
mpRules := "append"/[substitute(mp,'mpoly2,mpRules0) for mp in mps]
- $ResMode := CONS('(t1 t2 x y),
- EQSUBSTLIST($nameList,$abList,append(mpRules,$generalTMRules)))
+ $ResMode := ['(t1 t2 x y),
+ :EQSUBSTLIST($nameList,$abList,append(mpRules,$generalTMRules))]
true
createTypeEquivRules() ==
-- used by eqType, for example
- $TypeEQ := CONS('(t1), EQSUBSTLIST($nameList,$abList,'(
+ $TypeEQ := ['(t1), :EQSUBSTLIST($nameList,$abList,'(
((QF (P t1)) . (RF t1))
((QF (I)) . (RN))
- ((RE (RN)) . (RR)) )))
- $TypeEqui := CONS(first $TypeEQ, [[b,:a] for [a,:b] in rest $TypeEQ])
+ ((RE (RN)) . (RR)) ))]
+ $TypeEqui := [first $TypeEQ, :[[b,:a] for [a,:b] in rest $TypeEQ]]
true
initializeRuleSets() ==
diff --git a/src/interp/scan.boot b/src/interp/scan.boot
index 935a9597..8438212f 100644
--- a/src/interp/scan.boot
+++ b/src/interp/scan.boot
@@ -287,7 +287,7 @@ lineoftoks(s)==
$sz:local := nil
$floatok:local:=true
if not nextline s
- then CONS(nil,nil)
+ then [nil,:nil]
else
if null scanIgnoreLine($ln,$n) -- line of spaces or starts ) or >
then [nil,:$r]
diff --git a/src/interp/termrw.boot b/src/interp/termrw.boot
index e46a08d0..243812b7 100644
--- a/src/interp/termrw.boot
+++ b/src/interp/termrw.boot
@@ -50,7 +50,7 @@ termRW1(t,R) ==
tt1:= termRW1(t1,R)
tt2:= t2 and termRW1(t2,R)
EQ(t1,tt1) and EQ(t2,tt2) => t
- CONS(tt1,tt2)
+ [tt1,:tt2]
term1RW(t,R) ==
-- tries to reduce t at the top node
@@ -74,7 +74,7 @@ termMatch(tp,t,SL,vars) ==
atom tp =>
MEMQ(tp,vars) =>
p:= ASSOC(tp,SL) => ( rest p=t )
- CONS(CONS(tp,t),SL)
+ [[tp,:t],:SL]
'failed
atom t => 'failed
[tp1,:tp2]:= tp
@@ -98,10 +98,10 @@ termMatch(tp,t,SL,vars) ==
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)
+ q := [v,:t]
null SL => [q]
-- for p in SL repeat p.rest := SUBSTQ(t,v,rest p)
- CONS(q,SL)
+ [q,:SL]
mergeSubs(S1,S2) ==
-- augments S2 by each pair of S1
@@ -128,9 +128,9 @@ subCopyOrNil(t,SL) ==
atom t => NIL
[t1,:t2]:= t
t0:= subCopyOrNil(t1,SL) =>
- 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))
+ t2 => [t, :[rest t0,:subCopy0(t2,SL)]]
+ [t,:[rest t0,:t2]]
+ t2 and ( t0:= subCopyOrNil(t2,SL) ) => [t, :[t1,:rest t0]]
NIL
@@ -146,12 +146,12 @@ deepSubCopy0(t, SL) ==
deepSubCopyOrNil(t,SL) ==
-- the same as subCopy, but the result is NIL if nothing was copied
- p:= ASSOC(t,SL) => CONS(t, deepSubCopy0(rest p, SL))
+ p:= ASSOC(t,SL) => [t,:deepSubCopy0(rest p, SL)]
atom t => NIL
[t1,:t2]:= t
t0:= deepSubCopyOrNil(t1,SL) =>
- 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))
+ t2 => [t, :[rest t0,:deepSubCopy0(t2,SL)]]
+ [t,:[rest t0,:t2]]
+ t2 and ( t0:= deepSubCopyOrNil(t2,SL) ) => [t,:[t1,:rest t0]]
diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot
index d0265132..781c9e63 100644
--- a/src/interp/wi2.boot
+++ b/src/interp/wi2.boot
@@ -1096,7 +1096,7 @@ doItExpression(item,T) ==
wiReplaceNode(item,code, 22)
wiReplaceNode(node,ocode,key) ==
- ncode := CONS(first ocode, rest ocode)
+ ncode := [first ocode,:rest ocode]
code := replaceNodeInStructureBy(node,ncode)
SETQ($NODE,COPY node)
SETQ($NODE1, COPY first code)