aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap/utility.clisp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-10-04 00:01:48 +0000
committerdos-reis <gdr@axiomatics.org>2011-10-04 00:01:48 +0000
commit0204a2e9c993ee408d769cc6e2f91506b5699c81 (patch)
treed89e0a82d362e311218ce93d54b73454de6d8384 /src/boot/strap/utility.clisp
parent3be2028e7626877113e9c63530b5aeb982dc337a (diff)
downloadopen-axiom-0204a2e9c993ee408d769cc6e2f91506b5699c81.tar.gz
* boot/utility.boot (symbolAssoc): Rename from assocSymbol. Export.
* interp/functor.boot: Remove getAbbreviation, mkAbbrev, addsuffix. * interp/sys-utility.boot (symbolAssoc): Remove as redundant. (scalarTarget): New. * interp/bc-matrix.boot: Use symbolTarget instead of symbolLassoc. * interp/br-con.boot: Use QLASSQ instead of symbolTarget. * interp/br-data.boot: Likewise. * interp/br-op1.boot: Likewise. * interp/br-prof.boot: Likewise. * interp/br-saturn.boot: Likewise. * interp/br-search.boot: Likewise. * interp/buildom.boot: Likewise. * interp/c-doc.boot: Likewise. * interp/c-util.boot: Likewise. * interp/cattable.boot: Likewise. * interp/clam.boot: Likewise. * interp/define.boot: Likewise. * interp/format.boot: Likewise. * interp/g-timer.boot: Likewise. * interp/g-util.boot: Likewise. * interp/ht-util.boot: Likewise. * interp/htsetvar.boot: Likewise. * interp/i-intern.boot: Likewise. * interp/i-map.boot: Likewise. * interp/i-object.boot: Likewise. * interp/i-syscmd.boot: Likewise. * interp/lisplib.boot: Likewise. * interp/profile.boot: Likewise. * interp/trace.boot: Likewise. * interp/vmlisp.lisp (assoc): Tidy.
Diffstat (limited to 'src/boot/strap/utility.clisp')
-rw-r--r--src/boot/strap/utility.clisp50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/boot/strap/utility.clisp b/src/boot/strap/utility.clisp
index c42cc8f2..d522b8c8 100644
--- a/src/boot/strap/utility.clisp
+++ b/src/boot/strap/utility.clisp
@@ -19,8 +19,9 @@
|scalarMember?| |listMember?| |reverse| |reverse!|
|lastNode| |append| |append!| |copyList| |substitute|
|substitute!| |setDifference| |setUnion| |setIntersection|
- |applySubst| |applySubst!| |applySubstNQ| |objectAssoc|
- |remove| |removeSymbol| |atomic?| |finishLine|)))
+ |symbolAssoc| |applySubst| |applySubst!| |applySubstNQ|
+ |objectAssoc| |remove| |removeSymbol| |atomic?|
+ |finishLine|)))
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Thing| |%Thing|) |%Thing|) |substitute|))
@@ -49,11 +50,17 @@
(DECLAIM
(FTYPE
- (FUNCTION (|%Thing| (|%List| (|%Pair| |%Thing| |%Thing|)))
+ (FUNCTION (|%Thing| (|%List| |%Thing|))
(|%Maybe| (|%Pair| |%Thing| |%Thing|)))
|objectAssoc|))
(DECLAIM
+ (FTYPE
+ (FUNCTION (|%Symbol| (|%List| |%Thing|))
+ (|%Maybe| (|%Pair| |%Symbol| |%Thing|)))
+ |symbolAssoc|))
+
+(DECLAIM
(FTYPE (FUNCTION ((|%List| |%Thing|) (|%List| |%Thing|)) (|%List| |%Thing|))
|setDifference|))
@@ -172,15 +179,25 @@
(DEFUN |append| (|x| |y|) (|append!| (|copyList| |x|) |y|))
-(DEFUN |assocSymbol| (|s| |al|)
+(DEFUN |symbolAssoc| (|s| |l|)
(PROG (|x|)
(RETURN
(LOOP
(COND
- ((AND (CONSP |al|)
- (PROGN (SETQ |x| (CAR |al|)) (SETQ |al| (CDR |al|)) T))
- (COND ((AND (CONSP |x|) (EQ |s| (CAR |x|))) (IDENTITY (RETURN |x|)))))
- (T (RETURN NIL)))))))
+ ((NOT
+ (AND (CONSP |l|) (PROGN (SETQ |x| (CAR |l|)) (SETQ |l| (CDR |l|)) T)))
+ (RETURN NIL))
+ ((AND (CONSP |x|) (EQ |s| (CAR |x|))) (RETURN |x|)))))))
+
+(DEFUN |objectAssoc| (|x| |l|)
+ (PROG (|p|)
+ (RETURN
+ (LOOP
+ (COND
+ ((NOT
+ (AND (CONSP |l|) (PROGN (SETQ |p| (CAR |l|)) (SETQ |l| (CDR |l|)) T)))
+ (RETURN NIL))
+ ((AND (CONSP |p|) (EQ (CAR |p|) |x|)) (RETURN |p|)))))))
(DEFUN |substitute!| (|y| |x| |s|)
(COND ((NULL |s|) NIL) ((EQ |x| |s|) |y|)
@@ -208,7 +225,7 @@
(SETQ |tl| (|applySubst| |sl| (CDR |t|)))
(COND ((AND (EQ |hd| (CAR |t|)) (EQ |tl| (CDR |t|))) |t|)
(T (CONS |hd| |tl|))))
- ((AND (SYMBOLP |t|) (SETQ |p| (|assocSymbol| |t| |sl|))) (CDR |p|))
+ ((AND (SYMBOLP |t|) (SETQ |p| (|symbolAssoc| |t| |sl|))) (CDR |p|))
(T |t|)))))
(DEFUN |applySubst!| (|sl| |t|)
@@ -218,7 +235,7 @@
((CONSP |t|) (SETQ |hd| (|applySubst!| |sl| (CAR |t|)))
(SETQ |tl| (|applySubst!| |sl| (CDR |t|))) (RPLACA |t| |hd|)
(RPLACD |t| |tl|))
- ((AND (SYMBOLP |t|) (SETQ |p| (|assocSymbol| |t| |sl|))) (CDR |p|))
+ ((AND (SYMBOLP |t|) (SETQ |p| (|symbolAssoc| |t| |sl|))) (CDR |p|))
(T |t|)))))
(DEFUN |applySubstNQ| (|sl| |t|)
@@ -231,7 +248,7 @@
(SETQ |tl| (|applySubstNQ| |sl| |tl|))
(COND ((AND (EQ |hd| (CAR |t|)) (EQ |tl| (CDR |t|))) |t|)
(T (CONS |hd| |tl|))))))
- ((AND (SYMBOLP |t|) (SETQ |p| (|assocSymbol| |t| |sl|))) (CDR |p|))
+ ((AND (SYMBOLP |t|) (SETQ |p| (|symbolAssoc| |t| |sl|))) (CDR |p|))
(T |t|)))))
(DEFUN |setDifference| (|x| |y|)
@@ -335,17 +352,6 @@
((OR (CHARACTERP |x|) (INTEGERP |x|)) (|removeScalar| |l| |x|))
(T (|removeValue| |l| |x|))))
-(DEFUN |objectAssoc| (|x| |l|)
- (PROG (|a| |p|)
- (RETURN
- (LOOP
- (COND
- ((NOT
- (AND (CONSP |l|) (PROGN (SETQ |p| (CAR |l|)) (SETQ |l| (CDR |l|)) T)))
- (RETURN NIL))
- ((AND (CONSP |p|) (PROGN (SETQ |a| (CAR |p|)) T) (EQ |a| |x|))
- (RETURN |p|)))))))
-
(DEFUN |charPosition| (|c| |s| |k|)
(PROG (|n|)
(RETURN