aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-24 09:24:02 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-24 09:24:02 +0000
commit654d295a347b5d262f2fced49c4f010428ee207e (patch)
tree7eae5d401441d205b1bd041d1f992990ad276753 /src/interp
parentb297c03b5d2d5a6d88edc5e44548da67ee7c7082 (diff)
downloadopen-axiom-654d295a347b5d262f2fced49c4f010428ee207e.tar.gz
more cleanups
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 318d03e1..9d081520 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1141,7 +1141,8 @@ replaceSimpleFunctions form ==
form.op is "LET" =>
optLET mutateBindingFormWithUnaryFunction(form,function replaceSimpleFunctions)
form is ["spadConstant","$",n] =>
- null(op := getCapsuleDirectoryEntry n) => form
+ op := getCapsuleDirectoryEntry n
+ op = nil => form
-- Conservatively preserve object identity and storage
-- consumption by not folding non-atomic constant forms.
getFunctionReplacement op isnt ['XLAM,=nil,body] => form
@@ -1149,13 +1150,14 @@ replaceSimpleFunctions form ==
form
-- 1. process argument first.
for args in tails rest form repeat
- arg' := replaceSimpleFunctions(arg := first args)
- not EQ(arg',arg) =>
- args.first := arg'
+ arg := first args
+ arg' := replaceSimpleFunctions arg
+ not EQ(arg',arg) => args.first := arg'
-- 2. see if we know something about this function.
[fun,:args] := form
atom fun =>
- null (fun' := getFunctionReplacement fun) => form
+ fun' := getFunctionReplacement fun
+ fun' = nil => form
-- 2.1. the renaming case.
atom fun' =>
form.first := fun'
@@ -1235,12 +1237,13 @@ foldSpadcall form ==
mutateBindingFormWithUnaryFunction(form,function foldSpadcall)
form.op is '%when =>
mutateConditionalFormWithUnaryFunction(form,function foldSpadcall)
- for args in tails rest form repeat
- foldSpadcall first args
+ for x in form repeat
+ foldSpadcall x
form.op isnt 'SPADCALL => form
fun := lastNode form
fun isnt [["getShellEntry","$",slot]] => form
- null (op := getCapsuleDirectoryEntry slot) => form
+ op := getCapsuleDirectoryEntry slot
+ op = nil => form
fun.first := "$"
form.first := op