aboutsummaryrefslogtreecommitdiff
path: root/src/interp/compiler.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-01-22 00:25:02 +0000
committerdos-reis <gdr@axiomatics.org>2008-01-22 00:25:02 +0000
commitd0bef3fbe5196f2ac1211af52cc48d7d34187d3d (patch)
tree87976cf8eb431957d78b526f5200dffde52725d9 /src/interp/compiler.boot
parent1fec2e3a2ab2f97db90e18f03ec1c5df09a306b7 (diff)
downloadopen-axiom-d0bef3fbe5196f2ac1211af52cc48d7d34187d3d.tar.gz
Apply patch byStephen Wilson <<wilsons@multiboard.com>
Fix AW/370 * interp/compiler.boot (compWithMappingMode): Consult current environment to decide which variabes are free. * testsuite/compiler/cwmm-test.spad: New.
Diffstat (limited to 'src/interp/compiler.boot')
-rw-r--r--src/interp/compiler.boot15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 283b8868..1fba5482 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -188,39 +188,40 @@ compWithMappingMode(x,m is ["Mapping",m',:sl],oldE) ==
$FUNNAME :local := nil
$FUNNAME__TAIL :local := [nil]
expandedFunction:=COMP_-TRAN CADR uu
- frees:=FreeList(expandedFunction,vl,nil)
- where FreeList(u,bound,free) ==
+ frees:=FreeList(expandedFunction,vl,nil,e)
+ where FreeList(u,bound,free,e) ==
atom u =>
not IDENTP u => free
MEMQ(u,bound) => free
v:=ASSQ(u,free) =>
RPLACD(v,1+CDR v)
free
+ null getmode(u,e) => free
[[u,:1],:free]
op:=CAR u
MEMQ(op, '(QUOTE GO function)) => free
EQ(op,'LAMBDA) =>
bound:=UNIONQ(bound,CADR u)
for v in CDDR u repeat
- free:=FreeList(v,bound,free)
+ free:=FreeList(v,bound,free,e)
free
EQ(op,'PROG) =>
bound:=UNIONQ(bound,CADR u)
for v in CDDR u | NOT ATOM v repeat
- free:=FreeList(v,bound,free)
+ free:=FreeList(v,bound,free,e)
free
EQ(op,'SEQ) =>
for v in CDR u | NOT ATOM v repeat
- free:=FreeList(v,bound,free)
+ free:=FreeList(v,bound,free,e)
free
EQ(op,'COND) =>
for v in CDR u repeat
for vv in v repeat
- free:=FreeList(vv,bound,free)
+ free:=FreeList(vv,bound,free,e)
free
if ATOM op then u:=CDR u --Atomic functions aren't descended
for v in u repeat
- free:=FreeList(v,bound,free)
+ free:=FreeList(v,bound,free,e)
free
expandedFunction :=
--One free can go by itself, more than one needs a vector