diff options
author | dos-reis <gdr@axiomatics.org> | 2011-12-04 18:46:05 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-12-04 18:46:05 +0000 |
commit | a92d137e0a0de4abb7d680608b32e83b1b92ed9f (patch) | |
tree | 6006158f98faba33a2333f4107f72ed33ee6f2b2 /src/interp | |
parent | 25235d1ab4b8841e10e62414cea75294055375f9 (diff) | |
download | open-axiom-a92d137e0a0de4abb7d680608b32e83b1b92ed9f.tar.gz |
* interp/compiler.boot (freeVarUsage): Handle %bind and LET.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/compiler.boot | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 04807d73..b9788096 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -266,8 +266,8 @@ freeVarUsage([.,vars,body],env) == [[u,:1],:free] op := u.op op in '(QUOTE GO function) => free - op = "LAMBDA" => - bound := setUnion(bound, second u) + op in '(LAMBDA %lambda) => + bound := setUnion(u.absParms,bound) for v in CDDR u repeat free := freeList(v,bound,free,e) free @@ -276,6 +276,17 @@ freeVarUsage([.,vars,body],env) == for v in CDDR u | cons? v repeat free := freeList(v,bound,free,e) free + op = '%bind => + for [v,init] in second u repeat + bound := [v,:bound] + free := freeList(init,bound,free,e) + freeList(third u,bound,free,e) + op = 'LET => + locals := nil + for [v,init] in second u repeat + free := freeList(init,bound,free,e) + locals := [v,:locals] + freeList(third u,setUnion(locals,bound),free,e) op = '%seq => for v in rest u | cons? v repeat free := freeList(v,bound,free,e) |