aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-04-28 22:18:23 +0000
committerdos-reis <gdr@axiomatics.org>2012-04-28 22:18:23 +0000
commit9dbd3ec86d35a386d291fd59612ef7bb9a5b9ecf (patch)
tree68cf7484b0a6e5309cc046800a206e5e9e31a770
parent930f251621b0547076cef0ec9c44444a7e423bf2 (diff)
downloadopen-axiom-9dbd3ec86d35a386d291fd59612ef7bb9a5b9ecf.tar.gz
* interp/compiler.boot (finishLambdaExpression): Tidy.
(compWithMappingMode): Use %lambda not LAMBDA. * interp/g-opt.boot (changeVariableDefinitionToStore): Handle %closure.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/interp/compiler.boot4
-rw-r--r--src/interp/g-opt.boot6
3 files changed, 13 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index acb3a248..4e45dcb6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
2012-04-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/compiler.boot (finishLambdaExpression): Tidy.
+ (compWithMappingMode): Use %lambda not LAMBDA.
+ * interp/g-opt.boot (changeVariableDefinitionToStore): Handle %closure.
+
+2012-04-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/boot-pkg.lisp (gensym?): Check for non-null object.
* interp/clammed.boot: Use it in lieu of GENSYMP.
* interp/debug.lisp: Likewise.
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 9605b35b..71b679bc 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -304,7 +304,7 @@ freeVarUsage([.,vars,body],env) ==
++ Finish processing a lambda expression with parameter list `vars',
++ and `env' as the environement after the compilation its body.
-finishLambdaExpression(expr is ["LAMBDA",vars,.],env) ==
+finishLambdaExpression(expr is ['%lambda,vars,.],env) ==
$FUNNAME: local := nil
$FUNNAME__TAIL: local := [nil]
expandedFunction := transformToBackendCode expr
@@ -355,7 +355,7 @@ compWithMappingMode(x,m is ["Mapping",m',:sl],oldE) ==
[u,.,.] := t
[extractCode(u,nil),m,oldE]
[u,.,.]:= comp(x,m',e) or return nil
- [.,fun] := optimizeFunctionDef [nil,["LAMBDA",vl,u]]
+ [.,fun] := optimizeFunctionDef [nil,['%lambda,vl,u]]
[finishLambdaExpression(fun,e),m,oldE]
extractCode(u,vars) ==
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 57f518f1..ecf4b08c 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -101,7 +101,7 @@ changeLoopVarDefsToStore(iters,body,val,vars) ==
++ updated as opposed to being defined. `vars' is the list of
++ all variable definitions in scope.
changeVariableDefinitionToStore(form,vars) ==
- atomic? form or form.op is 'CLOSEDFN or form.op is 'XLAM => vars
+ atomic? form or form.op in '(CLOSEDFN XLAM) => vars
form is ['%LET,v,expr] =>
vars := changeVariableDefinitionToStore(expr,vars)
do
@@ -140,6 +140,9 @@ changeVariableDefinitionToStore(form,vars) ==
vars
form is ['%repeat,:iters,body,val] =>
changeLoopVarDefsToStore(iters,body,val,vars)
+ form is ['%closure,fun,env] =>
+ changeVariableDefinitionToStore(fun,vars)
+ vars
if form is ['%seq,:.] then
form.args := spliceSeqArgs form.args
for x in form repeat
@@ -149,6 +152,7 @@ changeVariableDefinitionToStore(form,vars) ==
++ Return true if `x' contains control transfer to a point outside itself.
jumpToToplevel? x ==
atomic? x => false
+ abstraction? x or op is '%closure => false
op := x.op
op is '%seq => CONTAINED('%leave,x.args) -- FIXME: what about GO?
op in '(%exit %leave) => true