From b91436e16c46bb3c8b0fa22d4f81eb8743f6cbd7 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 26 Nov 2011 20:11:59 +0000 Subject: * algebra/indexedp.spad.pamphlet: Avoid direct use or RPLACD. * algebra/poly.spad.pamphlet: Likewise. * interp/define.boot (spadCompileOrSetq): Tidy replacement info. * interp/i-output.boot ($BinaryOperators): New. (binaryInfix?): Tidy. --- src/algebra/indexedp.spad.pamphlet | 10 ++++++++-- src/algebra/poly.spad.pamphlet | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/algebra') diff --git a/src/algebra/indexedp.spad.pamphlet b/src/algebra/indexedp.spad.pamphlet index 1b60ecc4..d17d342c 100644 --- a/src/algebra/indexedp.spad.pamphlet +++ b/src/algebra/indexedp.spad.pamphlet @@ -132,8 +132,11 @@ IndexedDirectProductAbelianMonoid(A:AbelianMonoid,S:OrderedType): 0 == nil$List(Term) pretend % zero? x == null terms x + import %tail: List Term -> List Term from Foreign Builtin + qsetrest!: (List Term, List Term) -> List Term - qsetrest!(l, e) == RPLACD(l, e)$Lisp + qsetrest!(l, e) == + %store(%tail l,e)$Foreign(Builtin) -- PERFORMANCE CRITICAL; Should build list up -- by merging 2 sorted lists. Doing this will @@ -285,8 +288,11 @@ IndexedDirectProductAbelianGroup(A:AbelianGroup,S:OrderedType): [[termIndex u,a] for u in terms x | not zero?(a := n * termValue u)] pretend % + import %tail: List Term -> List Term from Foreign Builtin + qsetrest!: (List Term, List Term) -> List Term - qsetrest!(l, e) == RPLACD(l, e)$Lisp + qsetrest!(l, e) == + %store(%tail l,e)$Foreign(Builtin) x - y == x' := terms x diff --git a/src/algebra/poly.spad.pamphlet b/src/algebra/poly.spad.pamphlet index b86755a0..aeca4bf1 100644 --- a/src/algebra/poly.spad.pamphlet +++ b/src/algebra/poly.spad.pamphlet @@ -151,8 +151,11 @@ PolynomialRing(R:Ring,E:OrderedAbelianMonoid): T == C ground?(p): Boolean == empty? p or (empty? rest p and zero? degree p) + import %tail: Rep -> Rep from Foreign Builtin + qsetrest!: (Rep, Rep) -> Rep - qsetrest!(l: Rep, e: Rep): Rep == RPLACD(l, e)$Lisp + qsetrest!(l: Rep, e: Rep): Rep == + %store(%tail l,e)$Foreign(Builtin) entireRing? := R has EntireRing -- cgit v1.2.3