aboutsummaryrefslogtreecommitdiff
path: root/src/interp/nruncomp.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-15 16:03:04 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-15 16:03:04 +0000
commit0431131ebcdd17268513169c08fd1803a16d07f6 (patch)
tree37ef8acdebe805e3c51c1394e4e9a85f997e5104 /src/interp/nruncomp.boot
parentf94b3a2640bf842b92f22438fca79e58aeea5da9 (diff)
downloadopen-axiom-0431131ebcdd17268513169c08fd1803a16d07f6.tar.gz
* interp/nruncomp.boot (NRTputInHead): Tidy.
Diffstat (limited to 'src/interp/nruncomp.boot')
-rw-r--r--src/interp/nruncomp.boot31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot
index 45112f62..b22f65dc 100644
--- a/src/interp/nruncomp.boot
+++ b/src/interp/nruncomp.boot
@@ -662,21 +662,22 @@ NRTputInLocalReferences(db,bod) ==
NRTputInHead(db,bod)
NRTputInHead(db,bod) ==
- bod isnt [.,:.] => bod
- bod is ['SPADCALL,:args,fn] =>
- NRTputInTail(db,rest bod) --NOTE: args = copyTree of rest bod
- -- The following test allows function-returning expressions
- fn is [elt,dom,ind] and dom ~='$ and elt in '(ELT CONST) =>
- k := assocIndex(db,dom) => lastNode(bod).first := ['%tref,'_$,k]
- nil
- NRTputInHead(db,fn)
- bod
- bod is ['%when,:clauses] =>
- for cc in clauses repeat NRTputInTail(db,cc)
- bod
- bod.op in '(QUOTE CLOSEDFN) => bod
- NRTputInHead(db,first bod)
- NRTputInTail(db,rest bod)
+ ident? bod and (k := assocIndex(db,dom)) => ['%tref,'$,k]
+ do
+ bod isnt [.,:.] => nil
+ bod is ['SPADCALL,:args,fn] =>
+ NRTputInTail(db,rest bod) --NOTE: args = copyTree of rest bod
+ -- The following test allows function-returning expressions
+ fn is [elt,dom,ind] and dom ~='$ and elt in '(ELT CONST) =>
+ k := assocIndex(db,dom) => lastNode(bod).first := ['%tref,'_$,k]
+ NRTputInHead(db,fn)
+ bod.op is '%when =>
+ for cc in bod.args repeat NRTputInTail(db,cc)
+ bod.op in '(QUOTE CLOSEDFN) => nil
+ abstraction? bod =>
+ bod.absBody := NRTputInHead(db,bod.absBody)
+ NRTputInHead(db,first bod)
+ NRTputInTail(db,rest bod)
bod
NRTputInTail(db,x) ==