diff options
author | dos-reis <gdr@axiomatics.org> | 2012-05-02 13:11:00 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-05-02 13:11:00 +0000 |
commit | f7d7af754691e50267f2f21868949620ac6505cb (patch) | |
tree | 167c93abc6ce7dfe5875d289d8ace34b017b2e9b /src/interp | |
parent | 3a2f1fd5c85ba93860d6a7d205bcea2994374ecc (diff) | |
download | open-axiom-f7d7af754691e50267f2f21868949620ac6505cb.tar.gz |
* interp/c-util.boot (backendCompileSPADSLAM): Tidy. Do not
devaluate argument of unary constructors.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/c-util.boot | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 82c7c8ca..9e83d502 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1545,16 +1545,16 @@ backendCompileSLAM(name,args,body) == ++ table. This backend compiler is used to compile constructors. backendCompileSPADSLAM: (%Symbol,%List %Symbol,%Code) -> %Symbol backendCompileSPADSLAM(name,args,body) == - al := mkCacheName name -- name of the cache hash table. + al := mkCacheName name -- global name for the cache hash table. auxfn := makeSymbol strconc(name,'";") -- name of the worker function. - g1 := gensym() -- name of the worker function parameter - g2 := gensym() -- name for the cache value. + g2 := gensym() -- local name for the cache value. u := - null args => [nil,nil,[auxfn]] - null rest args => [[g1],["devaluate",g1],[auxfn,g1]] + args = nil => [nil,nil,[auxfn]] + args is [g] => [args,g,[auxfn,g]] + g1 := gensym() -- local binding to the worker parameter list [g1,["devaluateList",g1],["APPLY",["FUNCTION",auxfn],g1]] arg := first u -- parameter list - argtran := second u -- devaluate argument + argtran := second u -- argument to the worker app := third u -- code to compute value code := args = nil => ["COND",[al],[true,["SETQ",al,app]]] @@ -1564,14 +1564,13 @@ backendCompileSPADSLAM(name,args,body) == [true, ["PROGN",["SETQ",g2,app], ["SETQ",al,["cons5",["CONS",argtran, g2],al]],g2]]]] - lamex := ["LAM",arg,code] SETANDFILE(al,nil) -- define the global cache. -- compile the worker function first. u := [auxfn,["LAMBDA",args,:body]] if $PrettyPrint then PRETTYPRINT u COMP370 [u] - -- then compiler the stub (which is the user-visible constructor). - u := [name,lamex] + -- then compile the wrapper (which is the user-visible constructor). + u := [name,["LAM",arg,code]] if $PrettyPrint then PRETTYPRINT u COMP370 [u] name |