From 9a4759f38f13d4bf79133846eb5fd2aff58b2235 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 13 Jun 2010 13:04:44 +0000 Subject: * algebra/padic.spad.pamphlet (InnerPAdicInteger) [coerce]: Tidy. --- src/ChangeLog | 4 ++++ src/algebra/padic.spad.pamphlet | 11 +++++++---- src/algebra/polycat.spad.pamphlet | 1 - 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 374eb67c..9c1f2e42 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-06-13 Gabriel Dos Reis + + * algebra/padic.spad.pamphlet (InnerPAdicInteger) [coerce]: Tidy. + 2010-06-12 Gabriel Dos Reis * algebra/aggcat.spad.pamphlet (UnaryRecursiveAggregate) diff --git a/src/algebra/padic.spad.pamphlet b/src/algebra/padic.spad.pamphlet index 61e5ca9a..6b3481d1 100644 --- a/src/algebra/padic.spad.pamphlet +++ b/src/algebra/padic.spad.pamphlet @@ -290,18 +290,21 @@ InnerPAdicInteger(p,unBalanced?): Exports == Implementation where coerce(x:%):OUT == empty?(st := stream x) => 0 :: OUT - n : NNI ; count : NNI := _$streamCount$Lisp + count : NNI := _$streamCount$Lisp l : L OUT := empty() - for n in 0..count while not empty? st repeat + n : NNI := 0 + while n <= count while not empty? st repeat if frst(st) ~= 0 then l := concat(termOutput(n :: I,frst st),l) st := rst st + n := n + 1 if showAll?() then - for n in (count + 1).. while explicitEntries? st and _ - not eq?(st,rst st) repeat + n := count + 1 + while explicitEntries? st and not eq?(st,rst st) repeat if frst(st) ~= 0 then l := concat(termOutput(n pretend I,frst st),l) st := rst st + n := n + 1 l := explicitlyEmpty? st => l eq?(st,rst st) and frst st = 0 => l diff --git a/src/algebra/polycat.spad.pamphlet b/src/algebra/polycat.spad.pamphlet index a7d306f7..e48b3214 100644 --- a/src/algebra/polycat.spad.pamphlet +++ b/src/algebra/polycat.spad.pamphlet @@ -141,7 +141,6 @@ FiniteAbelianMonoidRing(R:Ring, E:OrderedAbelianMonoid): Category == ans,xn,yn: % bincoef: Integer powl: List(%):= [x] - i : Integer for i in 2..nn repeat powl:=[x * powl.first, :powl] yn:=y; ans:=powl.first; i:=1; bincoef:=nn for xn in powl.rest repeat -- cgit v1.2.3