aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-10-11 02:11:33 +0000
committerdos-reis <gdr@axiomatics.org>2008-10-11 02:11:33 +0000
commit567d3bbfc92aad2305987e3d6adedcb92615d5d5 (patch)
tree3ea82ce93405e7234c8cc2faf9b793419e2f8a76 /src/interp
parentb65e17e4ccd9f302b5dff63e65008b349c2b3f71 (diff)
downloadopen-axiom-567d3bbfc92aad2305987e3d6adedcb92615d5d5.tar.gz
* interp/c-util.boot (backendFluidize): New.
* interp/comp.lisp (COMP-TRAN): Use it. (COMP-FLUIDIZE): Remove.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot21
-rw-r--r--src/interp/comp.lisp15
2 files changed, 18 insertions, 18 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index c26887c2..d2bd035a 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1122,10 +1122,10 @@ backendCompileSPADSLAM(name,args,body) ==
COMP370 [u]
name
-
-backendCompile2 form ==
- form isnt [name,[type,args,:body],:junk] or junk ^= nil =>
- MOAN FORMAT(nil,'"******* parenthesis error in (~S (~S ...) ...)",name,type)
+backendCompile2: %Code -> %Symbol
+backendCompile2 code ==
+ code isnt [name,[type,args,:body],:junk] or junk ^= nil =>
+ systemError ['"parenthesis error in: ", code]
type = "SLAM" => backendCompileSLAM(name,args,body)
LASSQ(name,$clamList) => compClam(name,args,body,$clamList)
type = "SPADSLAM" => backendCompileSPADSLAM(name,args,body)
@@ -1136,3 +1136,16 @@ backendCompile2 form ==
else COMP370 [body]
name
+
+++ returns all fuild variables contained in `x'. Fuild variables are
+++ identifiers starting with '$', except domain variable names.
+backendFluidize x ==
+ IDENTP x and x ^= "$" and x ^= "$$" and
+ (PNAME x).0 = char "$" and not DIGITP((PNAME x).1) => x
+ isAtomicForm x => nil
+ first x = "FLUID" => second x
+ a := backendFluidize first x
+ b := backendFluidize rest x
+ a = nil => b
+ [a,:b]
+
diff --git a/src/interp/comp.lisp b/src/interp/comp.lisp
index 871cbe4c..46499b85 100644
--- a/src/interp/comp.lisp
+++ b/src/interp/comp.lisp
@@ -127,26 +127,13 @@
(if (or lvars (contained 'RETURN (third x)))
`(prog ,lvars (return ,(third x)))
(third x)) )))))
- (let ((fluids (S+ (comp-fluidize (second x)) SpecialVars)))
+ (let ((fluids (S+ (|backendFluidize| (second x)) SpecialVars)))
(if fluids
`(,(first x) ,(second x) (declare (special . ,fluids)) . ,(cddr x))
`(,(first x) ,(second x) . ,(cddr x))))))
; Fluidize: Returns a list of fluid variables in X
-(DEFUN COMP-FLUIDIZE (X)
- (COND ((AND (symbolp X)
- (NE X '$)
- (NE X '$$)
- (char= #\$ (ELT (PNAME X) 0))
- (NOT (DIGITP (ELT (PNAME X) 1))))
- x)
- ((atom x) nil)
- ((eq (first X) 'FLUID) (second X))
- ((let ((a (comp-fluidize (first x)))
- (b (comp-fluidize (rest x))))
- (if a (cons a b) b)))))
-
(DEFUN COMP\,FLUIDIZE (X) (COND
((AND (IDENTP X)
(NE X '$)