aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-12 18:53:51 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-12 18:53:51 +0000
commit2a2fe733e099430c34237fe7079e9af5590d6566 (patch)
tree635b55256127648be68e671f1e512cd3a8003895 /src
parent0ac37df817059cca37fd38f0512f3f6f3e269833 (diff)
downloadopen-axiom-2a2fe733e099430c34237fe7079e9af5590d6566.tar.gz
minor cleanup
Diffstat (limited to 'src')
-rw-r--r--src/interp/g-opt.boot9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 4ff87150..65259fc3 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -105,13 +105,14 @@ changeVariableDefinitionToStore(form,vars) ==
jumpToToplevel? x ==
atomic? x => false
op := x.op
- op = 'SEQ => CONTAINED('THROW,x.args)
+ op = 'SEQ => CONTAINED('THROW,x.args) -- FIXME: what about GO?
op in '(EXIT THROW %leave) => true
or/[jumpToToplevel? x' for x' in x]
++ Return true if `form' is just one assignment expression.
-singleAssignment? form ==
- form is ['%LET,.,rhs] and not CONTAINED('%LET,rhs)
+nonExitingSingleAssignment? form ==
+ form is ['%LET,.,rhs]
+ and not CONTAINED('%LET,rhs) and not jumpToToplevel? rhs
++ Turns `form' into a `%bind'-expression if it starts with a
++ a sequence of first-time variable definitions.
@@ -124,7 +125,7 @@ groupVariableDefinitions form ==
form
form isnt ['SEQ,:stmts,['EXIT,val]] => form
defs := nil
- for x in stmts while singleAssignment? x repeat
+ for x in stmts while nonExitingSingleAssignment? x repeat
defs := [x.args,:defs]
defs = nil or jumpToToplevel? defs => form
stmts := drop(#defs,stmts)