From 0431131ebcdd17268513169c08fd1803a16d07f6 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 15 May 2013 16:03:04 +0000 Subject: * interp/nruncomp.boot (NRTputInHead): Tidy. --- src/ChangeLog | 4 ++++ src/interp/nruncomp.boot | 31 ++++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 4145348c..653ed939 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-05-15 Gabriel Dos Reis + + * interp/nruncomp.boot (NRTputInHead): Tidy. + 2013-05-14 Gabriel Dos Reis * interp/g-opt.boot (quoteMode): New. 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) == -- cgit v1.2.3