aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/cparse.boot17
-rw-r--r--src/interp/cstream.boot14
-rw-r--r--src/interp/database.boot2
-rw-r--r--src/interp/define.boot2
-rw-r--r--src/interp/g-boot.boot12
-rw-r--r--src/interp/g-util.boot2
-rw-r--r--src/interp/i-analy.boot8
-rw-r--r--src/interp/i-coerce.boot2
-rw-r--r--src/interp/i-funsel.boot36
-rw-r--r--src/interp/i-output.boot2
-rw-r--r--src/interp/i-spec1.boot2
-rw-r--r--src/interp/i-spec2.boot8
-rw-r--r--src/interp/i-syscmd.boot4
-rw-r--r--src/interp/incl.boot87
-rw-r--r--src/interp/int-top.boot8
-rw-r--r--src/interp/macex.boot2
-rw-r--r--src/interp/msgdb.boot22
-rw-r--r--src/interp/pile.boot12
-rw-r--r--src/interp/posit.boot2
-rw-r--r--src/interp/ptrees.boot6
-rw-r--r--src/interp/scan.boot24
-rw-r--r--src/interp/setvars.boot8
-rw-r--r--src/interp/trace.boot4
-rw-r--r--src/interp/types.boot4
24 files changed, 144 insertions, 146 deletions
diff --git a/src/interp/cparse.boot b/src/interp/cparse.boot
index 93794987..8de2a2de 100644
--- a/src/interp/cparse.boot
+++ b/src/interp/cparse.boot
@@ -88,7 +88,8 @@ npNext() ==
$inputStream := rest($inputStream)
npFirstTok()
-npState()==cons($inputStream,$stack)
+npState() ==
+ [$inputStream,:$stack]
npRestore(x)==
$inputStream:=first x
@@ -175,7 +176,7 @@ npListofFun(f,h,g)==
a:=$stack
$stack:=nil
while APPLY(h,nil) and (APPLY(f,nil) or npTrap()) repeat 0
- $stack:=cons(nreverse $stack,a)
+ $stack := [nreverse $stack,:a]
npPush FUNCALL(g, [npPop3(),npPop2(),:npPop1()])
else
true
@@ -191,7 +192,7 @@ npList(f,str1,g)== -- always produces a list, g is applied to it
$stack:=nil
while npEqKey str1 and (npEqKey "BACKSET" or true) and
(APPLY(f,nil) or npTrap()) repeat 0
- $stack:=cons(nreverse $stack,a)
+ $stack := [nreverse $stack,:a]
npPush FUNCALL(g, [npPop3(),npPop2(),:npPop1()])
else
npPush FUNCALL(g, [npPop1()])
@@ -564,16 +565,16 @@ npZeroOrMore f==
a:=$stack
$stack:=nil
while APPLY(f,nil) repeat 0
- $stack:=cons(nreverse $stack,a)
- npPush cons(npPop2(),npPop1())
+ $stack := [nreverse $stack,:a]
+ npPush [npPop2(),:npPop1()]
npPush nil
true
npIterators()==
npForIn() and npZeroOrMore function npIterator
- and npPush cons(npPop2(),npPop1()) or
+ and npPush [npPop2(),:npPop1()] or
npWhile() and (npIterators() and
- npPush cons(npPop2(),npPop1()) or npPush [npPop1()])
+ npPush [npPop2(),:npPop1()] or npPush [npPop1()])
npIterator()== npForIn() or npSuchThat() or npWhile()
@@ -988,7 +989,7 @@ npListAndRecover(f)==
else
npNext()
c:=$inputStream
- b:=cons(npPop1(),b)
+ b := [npPop1(),:b]
$stack:=a
npPush nreverse b
diff --git a/src/interp/cstream.boot b/src/interp/cstream.boot
index b5ce37fb..0e176c0a 100644
--- a/src/interp/cstream.boot
+++ b/src/interp/cstream.boot
@@ -47,7 +47,8 @@ StreamNull x==
x.rest := rest st
x is ["nullstream",:.]
-Delay(f,x)==cons("nonnullstream",[f,:x])
+Delay(f,x) ==
+ ["nonnullstream",:[f,:x]]
StreamNil:= ["nullstream"]
@@ -59,20 +60,20 @@ incRgen1(:z)==
if null a
then (CLOSE s;StreamNil)
- else cons(a,incRgen s)
+ else [a,:incRgen s]
incIgen n==Delay(function incIgen1,[n])
incIgen1(:z)==
[n]:=z
n:=n+1
- cons(n,incIgen n)
+ [n,:incIgen n]
incZip(g,f1,f2)==Delay(function incZip1,[g,f1,f2])
incZip1(:z)==
[g,f1,f2]:=z
StreamNull f1 => StreamNil
StreamNull f2 => StreamNil
- cons(FUNCALL(g,car f1,car f2),incZip(g,cdr f1,cdr f2))
+ [FUNCALL(g,car f1,car f2),:incZip(g,cdr f1,cdr f2)]
incAppend(x,y)==Delay(function incAppend1,[x,y])
@@ -82,7 +83,7 @@ incAppend1(:z)==
then if StreamNull y
then StreamNil
else y
- else cons(car x,incAppend(cdr x,y))
+ else [car x,:incAppend(cdr x,y)]
next(f,s)==Delay(function next1,[f,s])
next1(:z)==
@@ -101,7 +102,8 @@ nextown1 (:z)==
h:=spadcall2 (f, s)
incAppend(car h,nextown(f,g,cdr h))
-nextown2(f,g,e,x)==nextown(cons(f,e),cons(g,e),x)
+nextown2(f,g,e,x) ==
+ nextown([f,:e],[g,:e],x)
spadcall1(g)==
[impl, :env] := g
diff --git a/src/interp/database.boot b/src/interp/database.boot
index afd2159e..92938d81 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -623,7 +623,7 @@ flattenSignatureList(x) ==
x is ['PROGN,:l] =>
ll:= []
for x in l repeat
- x is ['SIGNATURE,:.] => ll:=cons(x,ll)
+ x is ['SIGNATURE,:.] => ll := [x,:ll]
ll:= append(flattenSignatureList x,ll)
ll
nil
diff --git a/src/interp/define.boot b/src/interp/define.boot
index a08df9de..a7c28738 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -558,7 +558,7 @@ compDefineCategory(df,m,e,prefix,fal) ==
%CatObjRes -- result of compiling a category
- <=> cons(%Shell,cons(%Mode,cons(%Env,null)))
+ <=> [%Shell,:[%Mode,:[%Env,:null]]]
compMakeCategoryObject: (%Form,%Env) -> %Maybe %CatObjRes
compMakeCategoryObject(c,$e) ==
diff --git a/src/interp/g-boot.boot b/src/interp/g-boot.boot
index fc45f8d5..7b776706 100644
--- a/src/interp/g-boot.boot
+++ b/src/interp/g-boot.boot
@@ -265,7 +265,7 @@ defLET1(lhs,rhs) ==
l1 := defLET1(name,third rhs)
l2 := defLET1(lhs,name)
l2 is ["PROGN",:.] => MKPROGN [l1,:rest l2]
- if IDENTP first l2 then l2 := cons(l2,nil)
+ if IDENTP first l2 then l2 := [l2,:nil]
MKPROGN [l1,:l2,name]
g := INTERN STRCONC('"LETTMP#",STRINGIMAGE $letGenVarCounter)
$letGenVarCounter := $letGenVarCounter + 1
@@ -290,11 +290,11 @@ defLET2(lhs,rhs) ==
defLET2(var2,addCARorCDR('CDR,rhs))
l1 := defLET2(var1,addCARorCDR('CAR,rhs))
var2 in '(NIL _.) => l1
- if cons? l1 and atom first l1 then l1 := cons(l1,nil)
+ if cons? l1 and atom first l1 then l1 := [l1,:nil]
IDENTP var2 =>
[:l1,defLetForm(var2,addCARorCDR('CDR,rhs))]
l2 := defLET2(var2,addCARorCDR('CDR,rhs))
- if cons? l2 and atom first l2 then l2 := cons(l2,nil)
+ if cons? l2 and atom first l2 then l2 := [l2,:nil]
append(l1,l2)
lhs is ['APPEND,var1,var2] =>
patrev := defISReverse(var2,var1)
@@ -302,7 +302,7 @@ defLET2(lhs,rhs) ==
g := INTERN STRCONC('"LETTMP#",STRINGIMAGE $letGenVarCounter)
$letGenVarCounter := $letGenVarCounter + 1
l2 := defLET2(patrev,g)
- if cons? l2 and atom first l2 then l2 := cons(l2,nil)
+ if cons? l2 and atom first l2 then l2 := [l2,:nil]
var1 = "." => [[$LET,g,rev],:l2]
last l2 is [=$LET, =var1, val1] =>
[[$LET,g,rev],:reverse rest reverse l2,
@@ -324,7 +324,7 @@ defLET(lhs,rhs) ==
addCARorCDR(acc,expr) ==
atom expr => [acc,expr]
acc = 'CAR and expr is ["REVERSE",:.] =>
- cons('last,QCDR expr)
+ ['last,:QCDR expr]
funs := '(CAR CDR CAAR CDAR CADR CDDR CAAAR CADAR CAADR CADDR
CDAAR CDDAR CDADR CDDDR)
p := position(QCAR expr,funs)
@@ -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 cons? l2 and atom first l2 then l2 := cons(l2,nil)
+ if cons? l2 and atom first l2 then l2 := [l2,:nil]
a = "." => ['AND,rev,:l2]
['AND,rev,:l2,['PROGN,defLetForm(a,['NREVERSE,a]),''T]]
SAY '"WARNING (defIS1): possibly bad IS code being generated"
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 4a719772..4495805f 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -330,7 +330,7 @@ getUnionOrRecordTags u ==
tags := nil
if u is ['Union, :tl] or u is ['Record, :tl] then
for t in tl repeat
- if t is [":",tag,.] then tags := cons(tag, tags)
+ if t is [":",tag,.] then tags := [tag, :tags]
tags
--% Various lispy things
diff --git a/src/interp/i-analy.boot b/src/interp/i-analy.boot
index b2631fcc..de533d43 100644
--- a/src/interp/i-analy.boot
+++ b/src/interp/i-analy.boot
@@ -199,7 +199,7 @@ pushDownOp?(op,n) ==
-- now see which args have their count = numMms
ok := NIL
for i in 0..(n-1) repeat
- if numMms = sameAsTarg.i then ok := cons(i,ok)
+ if numMms = sameAsTarg.i then ok := [i,:ok]
reverse ok
--% Bottom Up Processing
@@ -773,7 +773,7 @@ bottomUpFormRetract(t,op,opName,argl,amsl) ==
-- check that we haven't seen these types before
typesHad := getAtree(t, 'typesHad)
if member(ms, typesHad) then b := nil
- else putAtree(t, 'typesHad, cons(ms, typesHad))
+ else putAtree(t, 'typesHad, [ms, :typesHad])
b and bottomUpForm(t,op,opName,a,amsl)
@@ -808,7 +808,7 @@ bottomUpFormAnyUnionRetract(t,op,opName,argl,amsl) ==
m.first := objMode(object)
putModeSet(x,[objMode(object)])
putValue(x,object)
- a := cons(x,a)
+ a := [x,:a]
b and bottomUpForm(t,op,opName,nreverse a,amsl)
bottomUpFormUntaggedUnionRetract(t,op,opName,argl,amsl) ==
@@ -831,7 +831,7 @@ bottomUpFormUntaggedUnionRetract(t,op,opName,argl,amsl) ==
m.first := objMode(object)
putModeSet(x,[objMode(object)])
putValue(x,object)
- a := cons(x,a)
+ a := [x,:a]
b and bottomUpForm(t,op,opName,nreverse a,amsl)
bottomUpElt (form:=[op,:argl]) ==
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index 92828a74..2acea070 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -1229,7 +1229,7 @@ computeTTTranspositions(t1,t2) ==
tower.(rest perm) := t
towers := CONS(VEC2LIST tower,towers)
towers := [reassembleTowerIntoType tower for tower in towers]
- if first(towers) ~= t2 then towers := cons(t2,towers)
+ if first(towers) ~= t2 then towers := [t2,:towers]
nreverse towers
decomposeTypeIntoTower t ==
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index 5ac3cc8a..f671ed6b 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -185,20 +185,20 @@ selectMms2(op,tar,args1,args2,$Coerce) ==
-- get the argument domains and the target
a := nil
- for x in args1 repeat if x then a := cons(x,a)
- for x in args2 repeat if x then a := cons(x,a)
- if tar and not isPartialMode tar then a := cons(tar,a)
+ for x in args1 repeat if x then a := [x,:a]
+ for x in args2 repeat if x then a := [x,:a]
+ if tar and not isPartialMode tar then a := [tar,:a]
-- for typically homogeneous functions, throw in resolve too
if op in '(_= _+ _* _- ) then
r := resolveTypeList a
- if r ~= nil then a := cons(r,a)
+ if r ~= nil then a := [r,:a]
if tar and not isPartialMode tar then
- if xx := underDomainOf(tar) then a := cons(xx,a)
+ if xx := underDomainOf(tar) then a := [xx,:a]
for x in args1 repeat
cons?(x) and first(x) in '(List Vector Stream FiniteSet Array) =>
- xx := underDomainOf(x) => a := cons(xx,a)
+ xx := underDomainOf(x) => a := [xx,:a]
-- now extend this list with those from the arguments to
-- any Unions, Mapping or Records
@@ -207,19 +207,19 @@ selectMms2(op,tar,args1,args2,$Coerce) ==
a := nreverse REMDUP a
for x in a repeat
null x => 'iterate
- x = '(RationalRadicals) => a' := cons($RationalNumber,a')
+ x = '(RationalRadicals) => a' := [$RationalNumber,:a']
x is ['Union,:l] =>
-- check if we have a tagged union
l and first l is [":",:.] =>
for [.,.,t] in l repeat
- a' := cons(t,a')
+ a' := [t,:a']
a' := append(reverse l,a')
x is ['Mapping,:l] => a' := append(reverse l,a')
x is ['Record,:l] =>
a' := append(reverse [third s for s in l],a')
x is ['FunctionCalled,name] =>
(xm := get(name,'mode,$e)) and not isPartialMode xm =>
- a' := cons(xm,a')
+ a' := [xm,:a']
a := append(a,REMDUP a')
a := [x for x in a | cons?(x)]
@@ -560,7 +560,7 @@ selectLocalMms(op,name,types,tar) ==
-- matchingMms := nil
-- for mm in mmS repeat
-- [., targ, :.] := mm
--- if tar = targ then matchingMms := cons(mm, matchingMms)
+-- if tar = targ then matchingMms := [mm,:matchingMms]
-- -- if we got some exact matchs on the target, return them
-- matchingMms => nreverse matchingMms
--
@@ -889,7 +889,7 @@ findFunctionInCategory(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
d is ['XLAM,xargs,:.] =>
if cons?(xargs) then maxargs := MAX(maxargs,#xargs)
else maxargs := MAX(maxargs,1)
- impls := cons([b,nil,true,d],impls)
+ impls := [[b,nil,true,d],:impls]
d isnt [k,"$",n] => systemErrorHere ["findFunctionInCategory",d]
impls := [[b,n,true,k],:impls]
impls := nreverse impls
@@ -986,11 +986,11 @@ filterModemapsFromPackages(mms, names, op) ==
"HomogeneousDistributedMultivariatePolynomial")
mpacks := '("MFactorize" "MRationalFactorize")
for mm in mms repeat
- isFreeFunctionFromMm(mm) => bad := cons(mm, bad)
+ isFreeFunctionFromMm(mm) => bad := [mm,:bad]
type := getDomainFromMm mm
- null type => bad := cons(mm,bad)
+ null type => bad := [mm,:bad]
if cons? type then type := first type
- getConstructorKindFromDB type = "category" => bad := cons(mm,bad)
+ getConstructorKindFromDB type = "category" => bad := [mm,:bad]
name := object2String type
found := nil
for n in names while not found repeat
@@ -999,8 +999,8 @@ filterModemapsFromPackages(mms, names, op) ==
(op = 'factor) and member(n,mpolys) and member(name,mpacks) =>
found := true
if found
- then good := cons(mm, good)
- else bad := cons(mm,bad)
+ then good := [mm,:good]
+ else bad := [mm,:bad]
[good,bad]
@@ -1311,8 +1311,8 @@ orderMmCatStack st ==
for v in vars while not mem repeat
if MEMQ(v,cat) then
mem := true
- havevars := cons(s,havevars)
- if not mem then haventvars := cons(s,haventvars)
+ havevars := [s,:havevars]
+ if not mem then haventvars := [s,:haventvars]
null havevars => st
st := nreverse nconc(haventvars,havevars)
SORT(st, function mmCatComp)
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index 3df78d82..9e145660 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -751,7 +751,7 @@ mkSuperSub(op,argl) ==
i=0 => ['AGGLST]
i=1 => first this
['AGGLST,:this]
- superSubPart := cons(scripts,superSubPart)
+ superSubPart := [scripts,:superSubPart]
superSub := ['SUPERSUB,cleanOp,:reverse superSubPart]
argl => [superSub,:argl]
superSub
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index f227089b..d72fb7f1 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -993,7 +993,7 @@ upconstruct t ==
mode := ['Stream, td]
evalInfiniteTupleConstruct(op, l, mode, tar)
if not isPartialMode(tar) and tar is ['List,ud] then
- mode := ['List, resolveTypeListAny cons(ud,eltTypes)]
+ mode := ['List, resolveTypeListAny [ud,:eltTypes]]
else mode := ['List, resolveTypeListAny eltTypes]
if isPartialMode tar then tar:=resolveTM(mode,tar)
evalconstruct(op,l,mode,tar)
diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot
index 8c654f0f..c9b691b7 100644
--- a/src/interp/i-spec2.boot
+++ b/src/interp/i-spec2.boot
@@ -650,14 +650,14 @@ upLETWithFormOnLhs(op,lhs,rhs) ==
let := mkAtreeNode "%LET"
t' := mkAtreeNode t
if m := getMode(l) then putMode(t',m)
- seq := cons([let,l,t'],seq)
+ seq := [[let,l,t'],:seq]
for t in temps for r in reverse rest rhs
for l in reverse rest lhs repeat
let := mkAtreeNode "%LET"
t' := mkAtreeNode t
if m := getMode(l) then putMode(t',m)
- seq := cons([let,t',r],seq)
- seq := cons(mkAtreeNode 'SEQ,seq)
+ seq := [[let,t',r],:seq]
+ seq := [mkAtreeNode 'SEQ,:seq]
ms := bottomUp seq
putValue(op,getValue seq)
putModeSet(op,ms)
@@ -1085,7 +1085,7 @@ uptuple t ==
argModeSetList:= [bottomUp x for x in l]
eltTypes := replaceSymbols([first x for x in argModeSetList],l)
if not isPartialMode(tar) and tar is ['Tuple,ud] then
- mode := ['Tuple, resolveTypeListAny cons(ud,eltTypes)]
+ mode := ['Tuple, resolveTypeListAny [ud,:eltTypes]]
else mode := ['Tuple, resolveTypeListAny eltTypes]
if isPartialMode tar then tar:=resolveTM(mode,tar)
evalTuple(op,l,mode,tar)
diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
index c75796f3..8092c467 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -1527,8 +1527,8 @@ importFromFrame args ==
vars := NIL
for [v,:props] in CAAR fenv repeat
v = "--macros" =>
- for [m,:.] in props repeat vars := cons(m,vars)
- vars := cons(v,vars)
+ for [m,:.] in props repeat vars := [m,:vars]
+ vars := [v,:vars]
importFromFrame [fname,:vars]
sayKeyedMsg("S2IZ0077",[fname])
for v in args repeat
diff --git a/src/interp/incl.boot b/src/interp/incl.boot
index c09ddcfe..f59e76ac 100644
--- a/src/interp/incl.boot
+++ b/src/interp/incl.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
@@ -277,84 +277,81 @@ incLude1 (:z) ==
StreamNull ss =>
not Top? state =>
- cons(xlPrematureEOF(eb,
- '")--premature end", lno,ufos), StreamNil)
+ [xlPrematureEOF(eb,
+ '")--premature end", lno,ufos), :StreamNil]
StreamNil
str := EXPAND_-TABS first ss
info := incClassify str
not info.0 =>
- Skipping? state => cons(xlSkip(eb,str,lno,ufos.0), Rest s)
- cons(xlOK(eb, str, lno, ufos.0),Rest s)
+ Skipping? state => [xlSkip(eb,str,lno,ufos.0), :Rest s]
+ [xlOK(eb, str, lno, ufos.0),:Rest s]
info.2 = '"other" =>
- Skipping? state => cons(xlSkip(eb,str,lno,ufos.0), Rest s)
- cons(xlOK1(eb, str,CONCAT('")command",str), lno, ufos.0),
- Rest s)
+ Skipping? state => [xlSkip(eb,str,lno,ufos.0), :Rest s]
+ [xlOK1(eb, str,CONCAT('")command",str), lno, ufos.0),
+ :Rest s]
info.2 = '"say" =>
- Skipping? state => cons(xlSkip(eb,str,lno,ufos.0), Rest s)
+ Skipping? state => [xlSkip(eb,str,lno,ufos.0), :Rest s]
str := incCommandTail(str, info)
- cons(xlSay(eb, str, lno, ufos, str),
- cons(xlOK(eb,str,lno,ufos.0), Rest s))
+ [xlSay(eb, str, lno, ufos, str),
+ :[xlOK(eb,str,lno,ufos.0), :Rest s]]
info.2 = '"include" =>
Skipping? state =>
- cons(xlSkip(eb,str,lno,ufos.0), Rest s)
+ [xlSkip(eb,str,lno,ufos.0), :Rest s]
fn1 := inclFname(str, info)
not fn1 =>
- cons(xlNoSuchFile(eb, str, lno,ufos,fn1),Rest s)
+ [xlNoSuchFile(eb, str, lno,ufos,fn1),:Rest s]
not PROBE_-FILE fn1 =>
- cons(xlCannotRead(eb, str, lno,ufos,fn1),Rest s)
+ [xlCannotRead(eb, str, lno,ufos,fn1),:Rest s]
incActive?(fn1,ufos) =>
- cons(xlFileCycle (eb, str, lno,ufos,fn1),Rest s)
+ [xlFileCycle (eb, str, lno,ufos,fn1),:Rest s]
Includee :=
incLude(eb+info.1,incFileInput fn1,0,
- cons(fn1,ufos), cons(Top,states))
- cons(
- xlOK(eb,str,lno,ufos.0),
- incAppend(Includee, Rest s))
+ [fn1,:ufos], [Top,:states])
+ [xlOK(eb,str,lno,ufos.0), :incAppend(Includee, Rest s)]
info.2 = '"console" =>
- Skipping? state => cons(xlSkip(eb,str,lno,ufos.0), Rest s)
+ Skipping? state => [xlSkip(eb,str,lno,ufos.0), :Rest s]
Head :=
incLude(eb+info.1,incConsoleInput(),0,
- cons('"console",ufos),cons(Top,states) )
+ ['"console",:ufos],[Top,:states])
Tail := Rest s
n := incNConsoles ufos
if n > 0 then
- Head := cons(xlConActive(eb, str, lno,ufos,n),Head)
+ Head := [xlConActive(eb, str, lno,ufos,n),:Head]
Tail :=
- cons(xlConStill (eb, str, lno,ufos,n),Tail)
+ [xlConStill (eb, str, lno,ufos,n),:Tail]
Head := cons (xlConsole(eb, str, lno,ufos), Head)
- cons(xlOK(eb,str,lno,ufos.0),incAppend(Head,Tail))
+ [xlOK(eb,str,lno,ufos.0),:incAppend(Head,Tail)]
info.2 = '"fin" =>
Skipping? state =>
- cons(xlSkippingFin(eb, str, lno,ufos), Rest s)
+ [xlSkippingFin(eb, str, lno,ufos), :Rest s]
not Top? state =>
- cons(xlPrematureFin(eb, str, lno,ufos), StreamNil)
- cons(xlOK(eb,str,lno,ufos.0), StreamNil)
+ [xlPrematureFin(eb, str, lno,ufos), :StreamNil]
+ [xlOK(eb,str,lno,ufos.0), :StreamNil]
info.2 = '"assert" =>
Skipping? state =>
- cons(xlSkippingFin(eb, str, lno,ufos), Rest s)
+ [xlSkippingFin(eb, str, lno,ufos), :Rest s]
assertCond(str, info)
- cons(xlOK(eb,str,lno,ufos.0), incAppend(Includee, Rest s))
+ [xlOK(eb,str,lno,ufos.0), :incAppend(Includee, Rest s)]
info.2 = '"if" =>
s1 :=
Skipping? state => IfSkipToEnd
if ifCond(str,info) then IfKeepPart else IfSkipPart
- cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,rest ss,lno,ufos,cons(s1,states)))
+ [xlOK(eb,str,lno,ufos.0),
+ :incLude(eb,rest ss,lno,ufos,[s1,:states])]
info.2 = '"elseif" =>
not If? state and not Elseif? state =>
- cons(xlIfSyntax(eb, str,lno,ufos,info,states),
- StreamNil)
+ [xlIfSyntax(eb, str,lno,ufos,info,states), :StreamNil]
if SkipEnd? state or KeepPart? state or SkipPart? state
then
@@ -365,36 +362,34 @@ incLude1 (:z) ==
then ElseifKeepPart
else ElseifSkipPart
else ElseifSkipToEnd
- cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,rest ss,lno,ufos,cons(s1,rest states)))
+ [xlOK(eb,str,lno,ufos.0),
+ :incLude(eb,rest ss,lno,ufos,[s1,:rest states])]
else
- cons(xlIfBug(eb, str, lno,ufos), StreamNil)
+ [xlIfBug(eb, str, lno,ufos), :StreamNil]
info.2 = '"else" =>
not If? state and not Elseif? state =>
- cons(xlIfSyntax(eb, str,lno,ufos,info,states),
- StreamNil)
+ [xlIfSyntax(eb, str,lno,ufos,info,states),:StreamNil]
if SkipEnd? state or KeepPart? state or SkipPart? state
then
s1 :=if SkipPart? state
then ElseKeepPart
else ElseSkipToEnd
- cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,rest ss,lno,ufos,cons(s1,rest states)))
+ [xlOK(eb,str,lno,ufos.0),
+ :incLude(eb,rest ss,lno,ufos,[s1,:rest states])]
else
- cons(xlIfBug(eb, str, lno,ufos), StreamNil)
+ [xlIfBug(eb, str, lno,ufos), :StreamNil]
info.2 = '"endif" =>
Top? state =>
- cons(xlIfSyntax(eb, str,lno,ufos,info,states),
- StreamNil)
- cons(xlOK(eb,str,lno,ufos.0),
- incLude(eb,rest ss,lno,ufos,rest states))
+ [xlIfSyntax(eb, str,lno,ufos,info,states),:StreamNil]
+ [xlOK(eb,str,lno,ufos.0),
+ :incLude(eb,rest ss,lno,ufos,rest states)]
info.2 = '"magicNumber" =>
Rest s
- cons(xlCmdBug(eb, str, lno,ufos), StreamNil)
+ [xlCmdBug(eb, str, lno,ufos),:StreamNil]
--% Message handling for the source includer
-- SMW June 88
diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot
index 30463f19..f08302ce 100644
--- a/src/interp/int-top.boot
+++ b/src/interp/int-top.boot
@@ -203,7 +203,7 @@ intloopEchoParse s==
setCurrentLine(mkLineList(lines))
if $EchoLines then ncloopPrintLines lines
$lines:=rest
- cons([[lines,npParse dqToList dq]],rest s)
+ [[[lines,npParse dqToList dq]],:rest s]
intloopInclude0(st, name, n) ==
$lines:local:=incStream(st,name)
@@ -320,8 +320,8 @@ streamChop(n,s)==
[a,b]:= streamChop(n-1,cdr s)
line:=car s
c:=ncloopPrefix?('")command",rest line)
- d:= cons(car line,if c then c else cdr line)
- [cons(d,a),b]
+ d:= [car line,:(if c then c else cdr line)]
+ [[d,:a],b]
ncloopPrintLines lines ==
for line in lines repeat WRITE_-LINE rest line
@@ -337,7 +337,7 @@ ncloopIncFileName string==
ncloopParse s==
[dq,stream]:=first s
[lines,rest]:=ncloopDQlines(dq,stream)
- cons([[lines,npParse dqToList dq]],rest s)
+ [[[lines,npParse dqToList dq]],:rest s]
ncloopInclude0(st, name, n) ==
$lines:local := incStream(st, name)
diff --git a/src/interp/macex.boot b/src/interp/macex.boot
index f426239f..f3966cc5 100644
--- a/src/interp/macex.boot
+++ b/src/interp/macex.boot
@@ -118,7 +118,7 @@ macMacro pf ==
pf
mac0Define(sy, state, body) ==
- $pfMacros := cons([sy, state, body], $pfMacros)
+ $pfMacros := [[sy, state, body],:$pfMacros]
-- Returns [state, body] or NIL.
mac0Get sy ==
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index 7559ffce..f3da9595 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -160,7 +160,7 @@ substituteSegmentedMsg(msg,args) ==
for x in segmentedMsgPreprocess msg repeat
-- x is a list
cons? x =>
- l := cons(substituteSegmentedMsg(x,args),l)
+ l := [substituteSegmentedMsg(x,args),:l]
c := x.0
n := STRINGLENGTH x
@@ -180,7 +180,7 @@ substituteSegmentedMsg(msg,args) ==
'"???"
-- now pull out qualifiers
q := NIL
- for i in 2..(n-1) repeat q := cons(x.i,q)
+ for i in 2..(n-1) repeat q := [x.i,:q]
-- Note 'f processing must come first.
if MEMQ(char 'f,q) then
arg :=
@@ -199,8 +199,8 @@ substituteSegmentedMsg(msg,args) ==
if MEMQ(char 'c,q) then arg := [['"%ce",:arg]]
if MEMQ(char 'r,q) then arg := [['"%rj",:arg]]
- if MEMQ(char 'l,q) then l := cons('"%l",l)
- if MEMQ(char 'b,q) then l := cons('"%b",l)
+ if MEMQ(char 'l,q) then l := ['"%l",:l]
+ if MEMQ(char 'b,q) then l := ['"%b",:l]
--we splice in arguments that are lists
--if y is not specified, then the adding of blanks is
--stifled after the first item in the list until the
@@ -212,15 +212,15 @@ substituteSegmentedMsg(msg,args) ==
head := first arg
tail := rest arg
['"%y",:append(reverse tail, ['"%n",head,:l ]) ]
- cons(arg,l)
- if MEMQ(char 'b,q) then l := cons('"%d",l)
+ [arg,:l]
+ if MEMQ(char 'b,q) then l := ['"%d",:l]
for ch in '(_. _, _! _: _; _?) repeat
- if MEMQ(char ch,q) then l := cons(ch,l)
+ if MEMQ(char ch,q) then l := [ch,:l]
c = char "%" and n > 1 and x.1 = char "x" and DIGITP x.2 =>
l := [fillerSpaces(DIG2FIX x.2, '" "),:l]
--x is a plain word
- l := cons(x,l)
+ l := [x,:l]
addBlanks nreverse l
addBlanks msg ==
@@ -287,7 +287,7 @@ cleanUpSegmentedMsg msg ==
for x in msg repeat
if haveBlank and (member(x,blanks) or member(x,prims)) then
msg1 := rest msg1
- msg1 := cons(x,msg1)
+ msg1 := [x,:msg1]
haveBlank := (member(x,blanks) => true; NIL)
msg1
@@ -773,7 +773,7 @@ brightPrintCenter(x,out == $OutputStream) ==
ok := true
while x and ok repeat
if member(first(x),'(%l "%l")) then ok := NIL
- else y := cons(first x, y)
+ else y := [first x, :y]
x := rest x
y := nreverse y
wid := sayBrightlyLength y
@@ -820,7 +820,7 @@ brightPrintRightJustify(x, out == $OutputStream) ==
ok := true
while x and ok repeat
if member(first(x),'(%l "%l")) then ok := NIL
- else y := cons(first x, y)
+ else y := [first x, :y]
x := rest x
y := nreverse y
wid := sayBrightlyLength y
diff --git a/src/interp/pile.boot b/src/interp/pile.boot
index 83e6b584..923adeb9 100644
--- a/src/interp/pile.boot
+++ b/src/interp/pile.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2009, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -62,11 +62,11 @@ insertpile (s)==
then
[h1,t1]:=pilePlusComments s
a:=pileTree(-1,t1)
- cons([pileCforest [:h1,a.2]],a.3)
+ [[pileCforest [:h1,a.2]],:a.3]
else
stream:=CADAR s
a:=pileTree(-1,s)
- cons([[a.2,stream]],a.3)
+ [[[a.2,stream]],:a.3]
pilePlusComments s==
if npNull s
@@ -76,7 +76,7 @@ pilePlusComments s==
if pilePlusComment h
then
[h1,t1]:=pilePlusComments t
- [cons(h,h1),t1]
+ [[h,:h1],t1]
else [[],s]
pileTree(n,s)==
@@ -104,7 +104,7 @@ pileForest(n,s)==
if b
then
[h1,t1]:=pileForest1(hh,t)
- [cons(h,h1),t1]
+ [[h,:h1],t1]
else [[],s]
pileForest1(n,s)==
@@ -112,7 +112,7 @@ pileForest1(n,s)==
if b
then
[h1,t1]:=pileForest1(n,t)
- [cons(h,h1),t1]
+ [[h,:h1],t1]
else [[],s]
pileForests(h,n,s)==
diff --git a/src/interp/posit.boot b/src/interp/posit.boot
index 0fa56b6d..974c5bdf 100644
--- a/src/interp/posit.boot
+++ b/src/interp/posit.boot
@@ -117,7 +117,7 @@ pfSourceToken form ==
--constructer and selectors for leaf tokens
tokConstruct(hd,tok,:pos)==
- a:=cons(hd,tok)
+ a := [hd,:tok]
IFCAR pos =>
pfNoPosition? first pos=> a
ncPutQ(a,"posn",first pos)
diff --git a/src/interp/ptrees.boot b/src/interp/ptrees.boot
index 0359ce41..ffcb4e92 100644
--- a/src/interp/ptrees.boot
+++ b/src/interp/ptrees.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2009, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -767,9 +767,9 @@ pfSexpr pform ==
args :=
a := pfApplicationArg pform
if pfTuple? a then pf0TupleParts a else [a]
- [strip p for p in cons(pfApplicationOp pform, args)]
+ [strip p for p in [pfApplicationOp pform, :args]]
- cons(pfAbSynOp pform, [strip p for p in pfParts pform])
+ [pfAbSynOp pform, :[strip p for p in pfParts pform]]
pfCopyWithPos( pform , pos ) ==
pfLeaf? pform => pfLeaf( pfAbSynOp pform , tokPart pform , pos )
diff --git a/src/interp/scan.boot b/src/interp/scan.boot
index ff113938..935a9597 100644
--- a/src/interp/scan.boot
+++ b/src/interp/scan.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2009, Gabriel Dos Reis.
+-- Copyright (C) 2007-2010, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -290,19 +290,19 @@ lineoftoks(s)==
then CONS(nil,nil)
else
if null scanIgnoreLine($ln,$n) -- line of spaces or starts ) or >
- then cons(nil,$r)
+ then [nil,:$r]
else
toks:=[]
a:= incPrefix?('"command",1,$ln)
a =>
$ln:=SUBSTRING($ln,8,nil)
b:= dqUnit constoken($ln,$linepos,["command",$ln],0)
- cons([[b,s]],$r)
+ [[[b,s]],:$r]
while $n<$sz repeat toks:=dqAppend(toks,scanToken())
if null toks
- then cons([],$r)
- else cons([[toks,s]],$r)
+ then [[],:$r]
+ else [[[toks,s]],:$r]
scanToken() ==
@@ -358,9 +358,9 @@ lferror x==["error",x]
lfspaces x==["spaces",x]
constoken(ln,lp,b,n)==
--- [b.0,b.1,cons(lp,n)]
- a:=cons(b.0,b.1)
- ncPutQ(a,"posn",cons(lp,n))
+-- [b.0,b.1,[lp,:n]]
+ a:=[b.0,:b.1]
+ ncPutQ(a,"posn",[lp,:n])
a
scanEscape()==
@@ -481,7 +481,7 @@ scanString()==
scanS()==
if $n>=$sz
then
- ncSoftError(cons($linepos,lnExtraBlanks $linepos+$n),"S2CN0001",[])
+ ncSoftError([$linepos,:lnExtraBlanks $linepos+$n],"S2CN0001",[])
'""
else
n:=$n
@@ -492,7 +492,7 @@ scanS()==
if mn=$sz
then
$n:=$sz
- ncSoftError(cons($linepos,lnExtraBlanks $linepos+$n),
+ ncSoftError([$linepos,:lnExtraBlanks $linepos+$n],
"S2CN0001",[])
SUBSTRING($ln,n,nil)
else if mn=strsym
@@ -593,7 +593,7 @@ scanCheckRadix(a,w)==
for i in 0..ns-1 repeat
a:=rdigit? w.i
if null a or a>=r
- then ncSoftError(cons($linepos,lnExtraBlanks $linepos+$n-ns+i),
+ then ncSoftError([$linepos,:lnExtraBlanks $linepos+$n-ns+i],
"S2CN0002", [w.i])
scanNumber() ==
@@ -682,7 +682,7 @@ rdigit? x==
scanError()==
n:=$n
$n:=$n+1
- ncSoftError(cons($linepos,lnExtraBlanks $linepos+$n),
+ ncSoftError([$linepos,:lnExtraBlanks $linepos+$n],
"S2CN0003",[$ln.n])
lferror ($ln.n)
diff --git a/src/interp/setvars.boot b/src/interp/setvars.boot
index ba9a85d2..590f4cfe 100644
--- a/src/interp/setvars.boot
+++ b/src/interp/setvars.boot
@@ -538,7 +538,7 @@ setExposeAddGroup arg ==
sayKeyedMsg("S2IZ0049H",[x])
member(x,$localExposureData.0) =>
sayKeyedMsg("S2IZ0049I",[x,$interpreterFrameName])
- $localExposureData.0 := MSORT cons(x,$localExposureData.0)
+ $localExposureData.0 := MSORT [x,:$localExposureData.0]
sayKeyedMsg("S2IZ0049R",[x,$interpreterFrameName])
clearClams()
@@ -560,7 +560,7 @@ setExposeAddConstr arg ==
-- if the constructor is explicitly hidden, then remove that
if member(x,$localExposureData.2) then
$localExposureData.2 := delete(x,$localExposureData.2)
- $localExposureData.1 := MSORT cons(x,$localExposureData.1)
+ $localExposureData.1 := MSORT [x,:$localExposureData.1]
clearClams()
sayKeyedMsg("S2IZ0049P",[x,$interpreterFrameName])
@@ -626,7 +626,7 @@ setExposeDropConstr arg ==
sayKeyedMsg("S2IZ0049O",[x,$interpreterFrameName])
if member(x,$localExposureData.1) then
$localExposureData.1 := delete(x,$localExposureData.1)
- $localExposureData.2 := MSORT cons(x,$localExposureData.2)
+ $localExposureData.2 := MSORT [x,:$localExposureData.2]
clearClams()
sayKeyedMsg("S2IZ0049Q",[x,$interpreterFrameName])
@@ -1103,7 +1103,7 @@ setOutputCharacters arg ==
for [char,:.] in $specialCharacterAlist repeat
s := STRCONC('" ",PNAME char,'" is shown as ",
PNAME specialChar(char))
- l := cons(s,l)
+ l := [s,:l]
sayAsManyPerLineAsPossible reverse l
arg is [fn] and (fn := DOWNCASE(fn)) =>
diff --git a/src/interp/trace.boot b/src/interp/trace.boot
index 486151d8..099d9ece 100644
--- a/src/interp/trace.boot
+++ b/src/interp/trace.boot
@@ -500,7 +500,7 @@ traceDomainLocalOps(dom,lops,options) ==
-- not MEMQ(internalName,actualLops) =>
-- sayMSG ['" ",:bright abb,'"does not have a local",
-- '" function called",:bright lop]
--- l := cons(internalName,l)
+-- l := [internalName,:l]
-- l => _/TRACE_,1(l,options)
-- nil
@@ -520,7 +520,7 @@ untraceDomainLocalOps(dom,lops) ==
-- not MEMQ(internalName,actualLops) =>
-- sayMSG ['" ",:bright abb,'"does not have a local",
-- '" function called",:bright lop]
--- l := cons(internalName,l)
+-- l := [internalName,:l]
-- l => untrace l
-- nil
diff --git a/src/interp/types.boot b/src/interp/types.boot
index 0fe9d04d..a9f67800 100644
--- a/src/interp/types.boot
+++ b/src/interp/types.boot
@@ -126,12 +126,12 @@ namespace BOOT
--% Data structures for the compiler
%Constructor <=> %Symbol -- constructor
%Form <=> %Number or %Symbol or %String or cons -- input syntax form
-%Instantiation <=> cons(%Constructor,%Form) -- constructor instance
+%Instantiation <=> [%Constructor,:%Form] -- constructor instance
%Env <=> %List -- compiling env
%Mode <=> %Symbol or %String or %List -- type of forms
%Code <=> %Form -- generated code
%Triple <=> -- form + type + env
- cons(%Code,cons(%Mode,cons(%Env,null)))
+ [%Code,:[%Mode,:[%Env,:null]]]
%Signature -- signature
<=> %Symbol or cons