aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/interp/compiler.boot4
-rw-r--r--src/interp/g-opt.boot12
-rw-r--r--src/interp/i-map.boot4
-rw-r--r--src/interp/i-special.boot6
-rw-r--r--src/interp/lisp-backend.boot10
-rw-r--r--src/interp/slam.boot2
7 files changed, 28 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3412327d..d4af37a2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
2011-12-15 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/compiler.boot: Rename %loop to %repeat. Propagate.
+ * interp/g-opt.boot: Likewise.
+ * interp/i-map.boot: Likewise.
+ * interp/i-special.boot: Likewise.
+ * interp/lisp-backend.boot: Likewise.
+ * interp/slam.boot: Likewise.
+
+2011-12-15 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot (modified?): Tidy.
2011-12-15 Gabriel Dos Reis <gdr@cs.tamu.edu>
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 434f3c93..b93ccd4e 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -2418,7 +2418,7 @@ compReduce1(form is ["REDUCE",op,.,collectForm],m,e,$formalArgList) ==
[untilCode,.,e]:= comp($until,$Boolean,e) or return nil
itl := substitute(["UNTIL",untilCode],'$until,itl)
firstTime := gensym()
- finalCode := ['%loop,
+ finalCode := ['%repeat,
['%init,accu,'%nil],['%init,firstTime,'%true],:itl,
['%bind,[[b,third bval]],
['%seq,
@@ -2475,7 +2475,7 @@ massageLoop x == main x where
x isnt ['%scope,tag,['REPEAT,:iters,body]] => x
nullifyTargetingLeaves(body,tag)
containsNonLocalControl?(body,nil) => systemErrorHere ['massageLoop,x]
- ['%scope,tag,['%loop,:iters,body,'%nil]]
+ ['%scope,tag,['%repeat,:iters,body,'%nil]]
containsNonLocalControl?(x,tags) ==
atomic? x => false
x is ['%leave,tag,x'] =>
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 0236e4f4..453ebbba 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -142,7 +142,7 @@ changeVariableDefinitionToStore(form,vars) ==
ident? form.op and abstractionOperator? form.op =>
changeVariableDefinitionToStore(form.absBody,[:form.absParms,:vars])
vars
- form is ['%loop,:iters,body,val] =>
+ form is ['%repeat,:iters,body,val] =>
changeLoopVarDefsToStore(iters,body,val,vars)
if form is ['%seq,:.] then
form.args := spliceSeqArgs form.args
@@ -181,7 +181,7 @@ groupVariableDefinitions form ==
mkBind(inits,groupVariableDefinitions expr)
form is ['%lambda,:.] =>
[form.absKind,form.absParms,groupVariableDefinitions form.absBody]
- form is ['%loop,:iters,body,val] =>
+ form is ['%repeat,:iters,body,val] =>
[form.op,:iters,groupVariableDefinitions body,val]
form isnt ['%seq,:stmts,['%exit,val]] => form
form.args = nil => nil
@@ -418,7 +418,7 @@ subrname u ==
nil
changeLeaveToExit(s,g) ==
- s isnt [.,:.] or s.op in '(QUOTE %seq REPEAT COLLECT %collect %loop) => nil
+ s isnt [.,:.] or s.op in '(QUOTE %seq REPEAT COLLECT %collect %repeat) => nil
s is ['%leave, =g,:u] => (s.first := '%exit; s.rest := u)
changeLeaveToExit(first s,g)
changeLeaveToExit(rest s,g)
@@ -666,7 +666,7 @@ modified?(var,form) ==
var' is [.,=var,:.] -- only part of it is modified
form is ['%bind,:.] and
(or/[symbolEq?(var,var') for [var',.] in form.absParms]) => true
- form is ['%loop,:iters,.,.] and
+ form is ['%repeat,:iters,.,.] and
(or/[symbolEq?(var,iteratorName i) for i in iters]) => true
abstraction? form and symbolMember?(var,form.absParms) => true
or/[modified?(var,f) for f in form]
@@ -703,7 +703,7 @@ canInlineVarDefinition(var,expr,body) ==
-- FIXME: except if the modification is done via normal function calls.
ident? expr => true
-- Conversatively stay out of loops
- cons? body and body.op in '(%loop %collect) => false
+ cons? body and body.op in '(%repeat %collect) => false
-- Linearly used internal temporaries should be replaced, and
-- so should side-effet free initializers for linear variables.
usageCount := numOfOccurencesOf(var,body)
@@ -786,7 +786,7 @@ optCollectVector form ==
iters := [:iters,['STEP,index,0,1]]
vec := gensym()
['%bind,[[vec,["makeSimpleArray",["getVMType",eltType],vecSize]]],
- ['%loop,:iters,["setSimpleArrayEntry",vec,index,body],vec]]
+ ['%repeat,:iters,["setSimpleArrayEntry",vec,index,body],vec]]
++ Translate retraction of a value denoted by `e' to sub-domain `m'
++ defined by predicate `pred',
diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot
index 9bb13e51..d654e787 100644
--- a/src/interp/i-map.boot
+++ b/src/interp/i-map.boot
@@ -231,7 +231,7 @@ getUserIdentifiersIn body ==
userIds :=
S_+(getUserIdentifiersInIterators itl,getUserIdentifiersIn body1)
S_-(userIds,getIteratorIds itl)
- body is ['%loop,:itl,val,body1] =>
+ body is ['%repeat,:itl,val,body1] =>
userIds :=
S_+(getUserIdentifiersInIterators itl,getUserIdentifiersIn body1)
userIds := S_+(getUserIdentifiersIn val,userIds)
@@ -1036,7 +1036,7 @@ findLocalVars1(op,form) ==
mkLocalVar(op,var)
form is [oper,:itrl,body] and oper in '(REPEAT COLLECT %collect) =>
findLocalsInLoop(op,itrl,body)
- form is ['%loop,:itrl,val,body] =>
+ form is ['%repeat,:itrl,val,body] =>
findLocalsInLoop(op,itrl,[body,val])
form is ['%bind,bindings,:body] =>
findExternalVarsInBindExpr(op,bindings,body)
diff --git a/src/interp/i-special.boot b/src/interp/i-special.boot
index 8cf776fc..a573b0f8 100644
--- a/src/interp/i-special.boot
+++ b/src/interp/i-special.boot
@@ -826,7 +826,7 @@ checkForFreeVariables(v,locals) ==
op in '(LAMBDA QUOTE getValueFromEnvironment) => v
op = "LETT" => -- Expands to a SETQ.
["SETF",:[checkForFreeVariables(a,locals) for a in args]]
- op in '(COLLECT REPEAT %collect %loop) =>
+ op in '(COLLECT REPEAT %collect %repeat) =>
first(args) is ["STEP",var,:.] =>
$boundVariables := [var,:$boundVariables]
r := [op,:[checkForFreeVariables(a,locals) for a in args]]
@@ -2226,7 +2226,7 @@ evalREPEAT(op,[:itrl,body],repeatMode) ==
bodyCode := getArgValue(body,bodyMode)
if $iterateCount > 0 then
bodyCode := ["CATCH",$repeatBodyLabel,bodyCode]
- code := ['%loop,:[evalLoopIter itr for itr in itrl],bodyCode,voidValue()]
+ code := ['%repeat,:[evalLoopIter itr for itr in itrl],bodyCode,voidValue()]
code := timedOptimization code
if $breakCount > 0 then code := ['CATCH,$repeatLabel,code]
val :=
@@ -2248,7 +2248,7 @@ interpREPEAT(op,itrl,body,repeatMode) ==
$indexTypes: local := nil
code :=
-- we must insert a CATCH for the iterate clause
- ['%loop,:[interpIter itr for itr in itrl],
+ ['%repeat,:[interpIter itr for itr in itrl],
["CATCH",$repeatBodyLabel,interpLoop(body,$indexVars,
$indexTypes,nil)],voidValue()]
SPADCATCH(eval $repeatLabel,timedEVALFUN code)
diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot
index 3ab11a8a..d5581dfe 100644
--- a/src/interp/lisp-backend.boot
+++ b/src/interp/lisp-backend.boot
@@ -153,7 +153,7 @@ massageFreeVarInits(body,inits) ==
['LET,inits,body]
-expandLoop ['%loop,:iters,body,ret] ==
+expandRepeat ['%repeat,:iters,body,ret] ==
itersCode := expandIterators iters
itersCode = "failed" => systemErrorHere ["expandLoop",iters]
body := middleEndExpand body
@@ -170,7 +170,7 @@ expandLoop ['%loop,:iters,body,ret] ==
exits = nil => body
['%when,[mkpf(exits,"OR"),["RETURN",expandToVMForm ret]],
[true,body]]
- body := ['%forever,exits,:cont]
+ body := ['%loop,exits,:cont]
-- Finally, set up loop-wide initializations.
expandToVMForm optimize! massageFreeVarInits(body,loopInits)
@@ -182,7 +182,7 @@ expandCollect ['%collect,:iters,body] ==
-- Initialize the variable holding the result; expand as
-- if ordinary loop. But don't forget we built the result
-- in reverse order.
- expandLoop ['%loop,:iters,["%init",val,nil],body,['%lreverse!,val]]
+ expandRepeat ['%repeat,:iters,["%init",val,nil],body,['%lreverse!,val]]
expandList(x is ['%list,:args]) ==
args := [expandToVMForm arg for arg in args]
@@ -653,7 +653,7 @@ for x in [
['%sptreq, :'EQL], -- system pointer equality
['%otherwise,:'T],
['%closure, :'CONS],
- ['%forever, :'LOOP],
+ ['%loop, :'LOOP],
['%funcall, :'FUNCALL],
['%function, :'FUNCTION],
['%lambda, :'LAMBDA],
@@ -670,7 +670,7 @@ for x in [
for x in [
['%list, :function expandList],
['%collect, :function expandCollect],
- ['%loop, :function expandLoop],
+ ['%repeat, :function expandRepeat],
['%return, :function expandReturn],
['%leave, :function expandLeave],
['%seq, :function expandSeq],
diff --git a/src/interp/slam.boot b/src/interp/slam.boot
index 10695b03..664aa18e 100644
--- a/src/interp/slam.boot
+++ b/src/interp/slam.boot
@@ -298,7 +298,7 @@ compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) ==
newValueCode:= ["%LET",g,substitute(gIndex,sharpArg,
applySubst(pairList(rest $TriangleVariableList,gsList),body))]
['%bind,decomposeBindings,
- ['%loop,["WHILE",true],["PROGN",endTest,advanceCode,
+ ['%repeat,["WHILE",true],["PROGN",endTest,advanceCode,
newValueCode,:rotateCode],voidValue()]]
fromScratchInit:=
[["%LET",gIndex,n],:[["%LET",g,x] for g in gsList for x in initCode]]