aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-12-28 06:12:21 +0000
committerdos-reis <gdr@axiomatics.org>2011-12-28 06:12:21 +0000
commit292bd212f1c30a51f0191128d5a9cd2691c5ccf9 (patch)
treeb3df4b4c43f312e5f0ac52dde5de9b3791833714 /src/interp
parent1fd6a63bbce9234ba3b8efa12c9a91643f0a87a1 (diff)
downloadopen-axiom-292bd212f1c30a51f0191128d5a9cd2691c5ccf9.tar.gz
* boot/tokens.boot: Remove redundant renaming of REM.
loopBody and loopExit are not selectors. * interp/i-output.boot: Include sys-utility. * interp/sys-utility.boot (last): New macro. (loopBody): Likewise. * interp/vmlisp.lisp (LASTNODE): Remove. (LASTPAIR): Likewise. (last): Do not define here.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/Makefile.in2
-rw-r--r--src/interp/g-opt.boot2
-rw-r--r--src/interp/i-output.boot1
-rw-r--r--src/interp/slam.boot2
-rw-r--r--src/interp/sys-utility.boot8
-rw-r--r--src/interp/vmlisp.lisp10
6 files changed, 13 insertions, 12 deletions
diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in
index 2157553b..5930d44f 100644
--- a/src/interp/Makefile.in
+++ b/src/interp/Makefile.in
@@ -279,7 +279,7 @@ osyscmd.$(FASLEXT): int-top.$(FASLEXT)
int-top.$(FASLEXT): incl.$(FASLEXT) i-toplev.$(FASLEXT) unlisp.$(FASLEXT)
i-toplev.$(FASLEXT): i-analy.$(FASLEXT)
i-syscmd.$(FASLEXT): i-object.$(FASLEXT)
-i-output.$(FASLEXT): sys-macros.$(FASLEXT)
+i-output.$(FASLEXT): sys-utility.$(FASLEXT) sys-macros.$(FASLEXT)
i-special.$(FASLEXT): i-analy.$(FASLEXT)
i-funsel.$(FASLEXT): i-coerfn.$(FASLEXT)
i-map.$(FASLEXT): i-object.$(FASLEXT)
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 880d088b..ef5b6a51 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -317,6 +317,8 @@ unnestWhen! x == f x where
x is ['%seq,:.] =>
for stmts in tails x.args repeat
stmts.first := f first stmts
+ x is ['%repeat,:.] =>
+ x.loopBody := unnestWhen! x.loopBody
x
++ Transform nested-to-tower.
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index 20028fc4..421e9386 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -32,6 +32,7 @@
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import sys_-utility
import sys_-macros
namespace BOOT
diff --git a/src/interp/slam.boot b/src/interp/slam.boot
index 11816e99..13768228 100644
--- a/src/interp/slam.boot
+++ b/src/interp/slam.boot
@@ -298,7 +298,7 @@ compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) ==
newValueCode:= ["%LET",g,substitute(gIndex,sharpArg,
applySubst(pairList(rest $TriangleVariableList,gsList),body))]
['%bind,decomposeBindings,
- ['%repeat,["WHILE",true],["PROGN",endTest,advanceCode,
+ ['%repeat,["WHILE",'%true],["PROGN",endTest,advanceCode,
newValueCode,:rotateCode],voidValue()]]
fromScratchInit:=
[["%LET",gIndex,n],:[["%LET",g,x] for g in gsList for x in initCode]]
diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot
index f9f7cbf8..96bd829b 100644
--- a/src/interp/sys-utility.boot
+++ b/src/interp/sys-utility.boot
@@ -406,6 +406,14 @@ displayTextFile f ==
stream ~= nil => closeStream stream
--%
+macro last x ==
+ lastNode(x).first
+
+--%
+macro loopBody x ==
+ take(-2,x).first
+
+--%
macro constructorDB ctor ==
property(ctor,'DATABASE)
diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp
index e922e1de..e571a161 100644
--- a/src/interp/vmlisp.lisp
+++ b/src/interp/vmlisp.lisp
@@ -174,12 +174,6 @@
(defmacro lam (&rest body)
(list 'quote (*lam (copy-tree body))))
-(defmacro lastnode (l)
- `(last ,l))
-
-(defmacro lastpair (l)
- `(last ,l))
-
(defmacro lessp (&rest args)
`(< ,@args))
@@ -665,10 +659,6 @@
((and (atom item) (not (arrayp item))) (member item sequence))
(T (member item sequence :test #'equalp))))
-; 14.2 Accessing
-
-(defun |last| (x) (car (lastpair x)))
-
; 14.3 Searching
(DEFUN |assoc| (X Y)