aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-01 21:02:41 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-01 21:02:41 +0000
commit50ffaabb3e56f7dec884c7e44c0fc0296772dfc8 (patch)
tree6e24f407fb4d1b871135cba4d7c794564b939874 /src/interp
parentedaf84d62bf70e3e3ad6ea4f910397f03b77688b (diff)
downloadopen-axiom-50ffaabb3e56f7dec884c7e44c0fc0296772dfc8.tar.gz
* boot/utility.boot (applySubstNQ): New.
* interp/compiler.boot (finishLambdaExpression): Use it. * interp/i-intern.boot (mkAtreeExpandMacros): Likewise. * interp/i-map.boot (addMap): Likewise. * interp/vmlisp.lisp (SUBLISNQ, SUBANQ, SUBB): Remove.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/compiler.boot2
-rw-r--r--src/interp/i-intern.boot4
-rw-r--r--src/interp/i-map.boot4
-rw-r--r--src/interp/macros.lisp15
4 files changed, 5 insertions, 20 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index c679cadd..68eac24f 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -337,7 +337,7 @@ finishLambdaExpression(expr is ["LAMBDA",vars,.],env) ==
rest v = 1 => slist := [[first v,:val],:slist]
scode := [[first v,val],:scode]
body :=
- slist => SUBLISNQ(slist,CDDR expandedFunction)
+ slist => applySubstNQ(slist,CDDR expandedFunction)
CDDR expandedFunction
if scode ~= nil then
body := [['%bind,reverse! scode,:body]]
diff --git a/src/interp/i-intern.boot b/src/interp/i-intern.boot
index 5138bd28..5a6b06f0 100644
--- a/src/interp/i-intern.boot
+++ b/src/interp/i-intern.boot
@@ -1,6 +1,6 @@
-- Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2010, Gabriel Dos Reis.
+-- Copyright (C) 2007-2011, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -88,7 +88,7 @@ mkAtreeExpandMacros x ==
[args,:body] := m
#args = #argl =>
sl := [[a,:s] for a in args for s in argl]
- x := SUBLISNQ(sl,body)
+ x := applySubstNQ(sl,body)
null args => x := [body,:argl]
x := [op,:argl]
x := [mkAtreeExpandMacros op,:argl]
diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot
index 373b3610..0d41f57b 100644
--- a/src/interp/i-map.boot
+++ b/src/interp/i-map.boot
@@ -180,8 +180,8 @@ addMap(lhs,rhs,pred) ==
argPredList:= reverse! predList
finalPred :=
-- handle g(a,T)==a+T confusion between pred=T and T variable
- MKPF((pred and (pred ~= 'T) => [:argPredList,SUBLISNQ($sl,pred)]; argPredList),"and")
- body:= SUBLISNQ($sl,rhs)
+ MKPF((pred and (pred ~= 'T) => [:argPredList,applySubstNQ($sl,pred)]; argPredList),"and")
+ body:= applySubstNQ($sl,rhs)
oldMap :=
(obj := get(op,'value,$InteractiveFrame)) => objVal obj
nil
diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp
index c98ab032..e2dbf4f1 100644
--- a/src/interp/macros.lisp
+++ b/src/interp/macros.lisp
@@ -210,21 +210,6 @@
((EQL (CDR L) TL) (RPLACD L NIL))
((TRUNCLIST-1 (CDR L) TL))))
-; 15.4 Substitution of Expressions
-
-(DEFUN SUBLISNQ (KEY E) (declare (special KEY)) (if (NULL KEY) E (SUBANQ E)))
-
-(DEFUN SUBANQ (E)
- (declare (special key))
- (COND ((ATOM E) (SUBB KEY E))
- ((EQCAR E (QUOTE QUOTE)) E)
- ((MAPCAR #'(LAMBDA (J) (SUBANQ J)) E))))
-
-(DEFUN SUBB (X E)
- (COND ((ATOM X) E)
- ((EQ (CAAR X) E) (CDAR X))
- ((SUBB (CDR X) E))))
-
; 15.5 Using Lists as Sets
(DEFUN PREDECESSOR (TL L)