aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-05-03 21:17:53 +0000
committerdos-reis <gdr@axiomatics.org>2012-05-03 21:17:53 +0000
commit3ac22c456c1d00c35957e7dad2bf10e7294ac6d5 (patch)
treeb786ecd64897ca1e0b004c0b765316db0d033c38 /src
parent6fc86e66f58fb9a9265121b847e7227ee133fd5b (diff)
downloadopen-axiom-3ac22c456c1d00c35957e7dad2bf10e7294ac6d5.tar.gz
* interp/g-opt.boot ($AbstractionOperator): Remove SLAM.
* interp/c-util.boot (backendCompileSLAM): Remove. (backendCompileSPADSLAM): Tidy. (backendCompile2): Adjust.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/interp/c-util.boot48
-rw-r--r--src/interp/g-util.boot2
3 files changed, 15 insertions, 42 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2ed9ae3e..c72a27bc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2012-05-03 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot ($AbstractionOperator): Remove SLAM.
+ * interp/c-util.boot (backendCompileSLAM): Remove.
+ (backendCompileSPADSLAM): Tidy.
+ (backendCompile2): Adjust.
+
+2012-05-03 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/define.boot (compDefineFunctor1): Use LAMBDA for the
resulting functor if not cachable.
* interp/clam.boot (compClam): Tidy.
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 5ef19f19..a67d2835 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1507,44 +1507,11 @@ backendCompileNEWNAM x ==
backendCompileNEWNAM first x
backendCompileNEWNAM rest x
-
-++ Lisp back end compiler for SLAM forms [namd,args,:body].
-++ A SLAM form is one that is `functional' in the sense that
+++ Lisp back end compiler for SPADSLAM forms [namd,args,:body].
+++ A SPADSLAM form is one that is `functional' in the sense that
++ its values are cached, so that equal lists of argument values
++ yield equal values. The arguments-value pairs are stored
-++ as alists.
-backendCompileSLAM: (%Symbol,%List %Symbol,%Code) -> %Symbol
-backendCompileSLAM(name,args,body) ==
- al := mkCacheName name -- name of the cache alist.
- auxfn := makeWorkerName name -- name of the worker function.
- g1 := gensym() -- name for the parameter.
- g2 := gensym() -- name for the cache value
- u := -- body of the stub function
- null args => [nil,[auxfn]]
- null rest args => [[g1],[auxfn,g1]]
- [g1,["APPLY", ["FUNCTION",auxfn], g1]]
- arg := first u
- app := second u
- codePart1 := -- look up the value if it is already there
- args ~= nil => [["SETQ", g2, ["assoc",g1,al]], ["CDR",g2]]
- [al]
- codePart2 := -- otherwise, compute it.
- args ~= nil => [true,["SETQ",g2,app],["SETQ",al,[[g1,:g2],:al]],g2]
- [true,["SETQ",al,app]]
- lamex := ["LAM",arg,["PROG",[g2],
- ["RETURN",["COND",codePart1,codePart2]]]]
- symbolValue(al) := nil -- clear the cache
- -- compile the worker function, first.
- u := [auxfn,["LAMBDA",args,:body]]
- COMP370 [u]
- -- then compile the original function.
- u := [name,lamex]
- if $PrettyPrint then PRETTYPRINT u
- COMP370 [u]
- name
-
-++ Same as backendCompileSLAM, except that the cache is a hash
-++ table. This backend compiler is used to compile constructors.
+++ in a hash table. This backend compiler is used to compile constructors.
backendCompileSPADSLAM: (%Symbol,%List %Symbol,%Code) -> %Symbol
backendCompileSPADSLAM(name,args,body) ==
al := mkCacheName name -- global name for the cache hash table.
@@ -1571,24 +1538,23 @@ backendCompileSPADSLAM(name,args,body) ==
-- compile the worker function first.
u := [auxfn,["LAMBDA",args,:body]]
if $PrettyPrint then PRETTYPRINT u
- COMP370 [u]
+ COMP370 u
-- then compile the wrapper (which is the user-visible constructor).
u := [name,["LAM",args,code]]
if $PrettyPrint then PRETTYPRINT u
- COMP370 [u]
+ COMP370 u
name
backendCompile2: %Code -> %Symbol
backendCompile2 code ==
- code isnt [name,[type,args,:body],:junk] or junk ~= nil =>
+ code isnt [name,[type,args,:body]] =>
systemError ['"parenthesis error in: ", code]
- type = "SLAM" => backendCompileSLAM(name,args,body)
symbolTarget(name,$clamList) => compClam(name,args,body,$clamList)
type = "SPADSLAM" => backendCompileSPADSLAM(name,args,body)
body := [name,[type,args,:body]]
if $PrettyPrint then PRETTYPRINT body
if not $COMPILE then SAY '"No Compilation"
- else COMP370 [body]
+ else COMP370 body
name
++ returns all fuild variables contained in `x'. Fuild variables are
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 6d8d41d7..95e4a47c 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -210,7 +210,7 @@ macro builtinConstructor? s ==
--%
$AbstractionOperator ==
- '(LAM ILAM SLAM XLAM SPADSLAM LAMBDA %lambda)
+ '(LAM ILAM XLAM SPADSLAM LAMBDA %lambda)
++ Return the character designated by the string `s'.
stringToChar: %String -> %Char