aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-07-27 12:24:31 +0000
committerdos-reis <gdr@axiomatics.org>2010-07-27 12:24:31 +0000
commitbddd53c126545232dc319fcf520a0070ab396818 (patch)
tree2a0018c952ab0434db10869bce99641609828524 /src/interp
parent6177d66b74f48a5cd63b62acad815299fcaaa884 (diff)
downloadopen-axiom-bddd53c126545232dc319fcf520a0070ab396818.tar.gz
Misc cleanup
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot28
-rw-r--r--src/interp/compiler.boot6
-rw-r--r--src/interp/define.boot2
-rw-r--r--src/interp/g-opt.boot20
-rw-r--r--src/interp/g-util.boot14
5 files changed, 35 insertions, 35 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index ca04d4fa..590c7766 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -168,7 +168,7 @@ wantArgumentsAsTuple(args,sig) ==
++ that are unused.
declareUnusedParameters x == (augment x; x) where
augment x ==
- isAtomicForm x => nil
+ atomic? x => nil
x is [op,parms,body] and op in $AbstractionOperator =>
augment body
unused := [p for p in parms | not usedSymbol?(p,body)]
@@ -1096,7 +1096,7 @@ middleEndExpand: %Form -> %Form
middleEndExpand x ==
x = '%false or x = '%nil => 'NIL
IDENTP x and (x' := x has %Rename) => x'
- isAtomicForm x => x
+ atomic? x => x
[op,:args] := x
IDENTP op and (fun := getOpcodeExpander op) =>
middleEndExpand apply(fun,x,nil)
@@ -1135,7 +1135,7 @@ eqSubst(args,parms,body) ==
++ Walk `form' and replace simple functions as appropriate.
replaceSimpleFunctions form ==
- isAtomicForm form => form
+ atomic? form => form
form is ["COND",:body] =>
mutateCONDFormWithUnaryFunction(form,"replaceSimpleFunctions")
form is ["LET",:.] =>
@@ -1145,7 +1145,7 @@ replaceSimpleFunctions form ==
-- Conservatively preserve object identity and storage
-- consumption by not folding non-atomic constant forms.
getFunctionReplacement op isnt ['XLAM,=nil,body] => form
- isAtomicForm body or isVMConstantForm body => body
+ atomic? body or isVMConstantForm body => body
form
-- 1. process argument first.
for args in tails rest form repeat
@@ -1167,7 +1167,7 @@ replaceSimpleFunctions form ==
-- Identity function toos.
parms is [=body] => first args
-- conservatively approximate eager semantics
- and/[isAtomicForm first as for as in tails args] =>
+ and/[atomic? first as for as in tails args] =>
-- alpha rename before substitution.
newparms := [gensym() for p in parms]
body := eqSubstAndCopy(newparms,parms,body)
@@ -1190,7 +1190,7 @@ forwardingCall?(vars,body) ==
++ Return true if `form' has a linear usage of all variables in `vars'.
usesVariablesLinearly?(form,vars) ==
- isAtomicForm form => true
+ atomic? form => true
and/[numOfOccurencesOf(var,form) < 2 for var in vars]
++ We are processing a function definition with parameter list `vars'
@@ -1208,10 +1208,10 @@ expandableDefinition?(vars,body) ==
-- FIXME: This should be done only for constant creators.
null vars' => semiSimpleRelativeTo?(body,$VMsideEffectFreeOperators)
- isAtomicForm body => true
+ atomic? body => true
[op,:args] := body
not IDENTP op => false
- and/[isAtomicForm x for x in args]
+ and/[atomic? x for x in args]
or semiSimpleRelativeTo?(body,$simpleVMoperators) =>
usesVariablesLinearly?(body,vars')
false
@@ -1224,7 +1224,7 @@ expandableDefinition?(vars,body) ==
++ domain. Conditional operations are not folded.
foldSpadcall: %Form -> %Form
foldSpadcall form ==
- isAtomicForm form => form -- leave atomic forms alone
+ atomic? form => form -- leave atomic forms alone
form is ["DECLARE",:.] => form -- don't walk declarations
form is ["LET",inits,:body] =>
mutateLETFormWithUnaryFunction(form,"foldSpadcall")
@@ -1321,7 +1321,7 @@ MAKE_-CLOSEDFN_-NAME() ==
backendCompileNEWNAM: %Form -> %Void
backendCompileNEWNAM x ==
- isAtomicForm x => nil
+ atomic? x => nil
atom(y := first x) =>
backendCompileNEWNAM rest x
if y = "CLOSEDFN" then
@@ -1422,7 +1422,7 @@ backendCompile2 code ==
backendFluidize x ==
IDENTP x and x ~= "$" and x ~= "$$" and
(PNAME x).0 = char "$" and not digit?((PNAME x).1) => x
- isAtomicForm x => nil
+ atomic? x => nil
first x = "FLUID" => second x
a := backendFluidize first x
b := backendFluidize rest x
@@ -1522,7 +1522,7 @@ ilTransformInsns form ==
mutateToBackendCode: %Form -> %Void
mutateToBackendCode x ==
IDENTP x and isLispSpecialVariable x => noteSpecialVariable x
- isAtomicForm x => nil
+ atomic? x => nil
-- temporarily have TRACELET report MAKEPROPs.
if (u := first x) = "MAKEPROP" and $TRACELETFLAG then
x.first := "MAKEPROP-SAY"
@@ -1587,7 +1587,7 @@ declareGlobalVariables vars ==
["DECLARE",["SPECIAL",:vars]]
simplifySEQ form ==
- isAtomicForm form => form
+ atomic? form => form
form is ["SEQ",[op,a]] and op in '(EXIT RETURN) => simplifySEQ a
for stmts in tails form repeat
stmts.first := simplifySEQ first stmts
@@ -1596,7 +1596,7 @@ simplifySEQ form ==
++ Return true if the Lisp `form' has a `RETURN' form
++ that needs to be enclosed in a `PROG' form.
needsPROG? form ==
- isAtomicForm form => false
+ atomic? form => false
op := form.op
op = 'RETURN => true
op in '(LOOP PROG) => false
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 85f796bc..7260aa84 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1048,7 +1048,7 @@ compSeqItem(x,m,e) ==
replaceExitEtc(x,tag,opFlag,opMode) ==
(fn(x,tag,opFlag,opMode); x) where
fn(x,tag,opFlag,opMode) ==
- isAtomicForm x => nil
+ atomic? x => nil
x is [ =opFlag,n,t] =>
second(x.args).expr :=
replaceExitEtc(second(x.args).expr,tag,opFlag,opMode)
@@ -2292,7 +2292,7 @@ massageLoop x == main x where
containsNonLocalControl?(body,nil) => systemErrorHere ['massageLoop,x]
['CATCH,tag,['%loop,:iters,body,'%nil]]
replaceThrowWithLeave(x,tag) ==
- isAtomicForm x => nil
+ atomic? x => nil
x is ['THROW,=tag,expr] =>
replaceThrowWithLeave(expr,tag)
-- Avoid redudant THROW for return-expressions.
@@ -2304,7 +2304,7 @@ massageLoop x == main x where
x.args := rest x.args
for x' in x repeat replaceThrowWithLeave(x',tag)
containsNonLocalControl?(x,tags) ==
- isAtomicForm x => false
+ atomic? x => false
x is ['THROW,tag,x'] =>
not(tag in tags) or containsNonLocalControl?(x',tags)
x is ['CATCH,tag,x'] =>
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 4403b26a..2fb14a5f 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -587,7 +587,7 @@ typeDependencyPath(m,path,e) ==
IDENTP m and assoc(m,$whereDecls) =>
get(m,'value,e) => nil -- parameter was given value
[[m,:reverse path],:typeDependencyPath(getmode(m,e),path,e)]
- isAtomicForm m => nil
+ atomic? m => nil
[ctor,:args] := m
-- We don't expect implicit parameters in builtin constructors.
ctor in $BuiltinConstructorNames => nil
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 2a1065b8..ca4dd8a4 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -70,7 +70,7 @@ emitIndirectCall(fn,args,x) ==
++ updated as opposed to being defined. `vars' is the list of
++ all variable definitions in scope.
changeVariableDefinitionToStore(form,vars) ==
- isAtomicForm form => nil
+ atomic? form => nil
form is ['%LET,v,expr] =>
changeVariableDefinitionToStore(expr,vars)
if v in vars then form.op := '%store
@@ -81,7 +81,7 @@ changeVariableDefinitionToStore(form,vars) ==
++ Return true if `x' contains control transfer to a point outside itself.
jumpToToplevel? x ==
- isAtomicForm x => false
+ atomic? x => false
op := x.op
op = 'SEQ => CONTAINED('THROW,x.args)
op in '(EXIT THROW %leave) => true
@@ -94,7 +94,7 @@ singleAssignment? form ==
++ Turns `form' into a `%bind'-expression if it starts with a
++ a sequence of first-time variable definitions.
groupVariableDefinitions form ==
- isAtomicForm form => form
+ atomic? form => form
form isnt ['SEQ,:stmts,['EXIT,val]] => form
defs := nil
for x in stmts while singleAssignment? x repeat
@@ -149,7 +149,7 @@ resetTo(x,y) ==
simplifyVMForm x ==
x = '%icst0 => 0
x = '%icst1 => 1
- isAtomicForm x => x
+ atomic? x => x
x.op = 'CLOSEDFN => x
atom x.op =>
x is [op,vars,body] and op in $AbstractionOperator =>
@@ -195,7 +195,7 @@ changeThrowToGo(s,g) ==
++ out of the function body anyway. Similarly, transform
++ reudant `(THROW tag (THROW tag expr))' to `(THROW tag expr)'.
removeNeedlessThrow x ==
- isAtomicForm x => x
+ atomic? x => x
x is ['THROW,.,y] and y is ['%return,:.] =>
removeNeedlessThrow third y
x.op := y.op
@@ -371,14 +371,14 @@ optCONDtail l ==
replaceableTemporary?(g,x) ==
GENSYMP g and numOfOccurencesOf(g,x) < 2 and not jumpTarget?(g,x) where
jumpTarget?(g,x) ==
- isAtomicForm x => false
+ atomic? x => false
x is ['GO,=g] => true
or/[jumpTarget?(g,x') for x' in x]
optSEQ ["SEQ",:l] ==
tryToRemoveSEQ SEQToCOND getRidOfTemps splicePROGN l where
splicePROGN l ==
- isAtomicForm l => l
+ atomic? l => l
l is [["PROGN",:stmts],:l'] => [:stmts,:l']
l.rest := splicePROGN rest l
getRidOfTemps l ==
@@ -459,7 +459,7 @@ $simpleVMoperators ==
++ Return true if the `form' is semi-simple with respect to
++ to the list of operators `ops'.
semiSimpleRelativeTo?(form,ops) ==
- isAtomicForm form => true
+ atomic? form => true
form isnt [op,:args] or not MEMQ(op,ops) => false
and/[semiSimpleRelativeTo?(f,ops) for f in args]
@@ -500,7 +500,7 @@ findVMFreeVars form ==
++ Return true is `var' is the left hand side of an assignment
++ in `form'.
varIsAssigned(var,form) ==
- isAtomicForm form => false
+ atomic? form => false
form is [op,=var,:.] and op in '(%LET LETT SETQ %store) => true
or/[varIsAssigned(var,f) for f in form]
@@ -558,7 +558,7 @@ optLET u ==
continue => body
u
not MEMQ(op,$simpleVMoperators) => u
- not(and/[isAtomicForm arg for arg in args]) => u
+ not(and/[atomic? arg for arg in args]) => u
-- Inline only if all parameters are used. Get cute later.
not(and/[MEMQ(x,args) for [x,.] in inits]) => u
-- Munge inits into list of dotted-pairs. Lovely Lisp.
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index c1cc9217..a2cda77b 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -38,7 +38,7 @@ import sys_-utility
namespace BOOT
module g_-util where
- isAtomicForm: %Form -> %Boolean
+ atomic?: %Thing -> %Boolean
getTypeOfSyntax: %Form -> %Mode
pairList: (%List,%List) -> %List
mkList: %List -> %List
@@ -145,13 +145,13 @@ expandSTEP(id,lo,step,final)==
final := middleEndExpand final
loopvar := [[id,lo]]
inc :=
- isAtomicForm step => step
+ atomic? step => step
g1 := gensym()
loopvar := [:loopvar,[g1,step]]
g1
final :=
atom final => final
- final is [hi] and isAtomicForm hi => hi
+ final is [hi] and atomic? hi => hi
g2 := gensym()
loopvar := [:loopvar,[g2,:final]]
g2
@@ -492,7 +492,7 @@ getOpcodeExpander op ==
expandToVMForm x ==
x = '%false or x = '%nil => 'NIL
IDENTP x and (x' := x has %Rename) => x'
- isAtomicForm x => x
+ atomic? x => x
[op,:args] := x
IDENTP op and (fun:= getOpcodeExpander op) => apply(fun,x,nil)
op' := expandToVMForm op
@@ -530,9 +530,9 @@ isSharpVarWithNum x ==
ok := digit? d => c := 10*c + DIG2FIX d
if ok then c else nil
-++ Returns true if `form' is either an atom or a quotation.
-isAtomicForm form ==
- atom form or first form = "QUOTE"
+++ Returns true if `x' is either an atom or a quotation.
+atomic? x ==
+ not cons? x or x.op = 'QUOTE
--% Sub-domains information handlers