From 258d6427280f1ee0cce0dcdf12c38ad65b5e36cc Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 6 Jan 2009 06:53:21 +0000 Subject: * interp/sys-utility.boot (getVMType): IndexList are lists. * interp/g-util.boot (isSubDomain): Tidy. * interp/g-opt.boot (isVMConstantForm): New. (findVMFreeVars): Likewise. * interp/define.boot (insertViewMorphisms): Remove. (emitSubdomainInfo): New. (checkVariableName): Likewise. (checkParameterNames): Likewise. (checkRepresentation): Set $subdomain where appropriate. (compDefines): Check parameter names. (compDefineFunctor1): Propagate subdomain info. (doIt): Don't call insertViewMorphisms. * interp/compiler.boot (setqSingle): Check variable name. (compIterator): Likewise. (commonSuperType): New. (satisfies): Likewise. (coerceSubset): Use them to implemen cross-subdomain coercion. (coerceSuperset): New. (comCoerce1): Use it. (compPer): New. (compRep): Likewise. * interp/c-util.boot (getRepresentation): New. (proclaimCapsuleFunction): Improve for specialized subdomains. * algebra/stream.spad.pamphlet: Don't use `per' as variable name. * algebra/si.spad.pamphlet (size$SingleInteger): Tidy. (coerce$SingleInteger): Likewise. * algebra/reclos.spad.pamphlet (nonNull$RealClosure): Don't use `rep' as parameter name. * algebra/data.spad.pamphlet (Byte): Now a subdomain of NonNegativeInteger. Tidy. --- src/algebra/stream.spad.pamphlet | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/algebra/stream.spad.pamphlet') diff --git a/src/algebra/stream.spad.pamphlet b/src/algebra/stream.spad.pamphlet index a691aab2..aa23b60c 100644 --- a/src/algebra/stream.spad.pamphlet +++ b/src/algebra/stream.spad.pamphlet @@ -553,7 +553,6 @@ CyclicStreamTools(S,ST): Exports == Implementation where -- As explained below, in the capsule, the Rep for STREAM is actually -- a half lie. So, the system should not be allowed to trust it. )boot $optProclaim := false -import Type import Void import Boolean import Integer @@ -1062,12 +1061,12 @@ Stream(S): Exports == Implementation where i := 0; while not eq?(x,tl) repeat (x := rst x; i := i + 1) i = n => [false, 0, 0] -- Find period. Now x=tl, so step over and find it again. - x := rst x; per := 1 - while not eq?(x,tl) repeat (x := rst x; per := per + 1) + x := rst x; periode := 1 + while not eq?(x,tl) repeat (x := rst x; periode := periode + 1) -- Find non-periodic part. - x := hd; xp := rest(hd, per); npp := 0 + x := hd; xp := rest(hd, periode); npp := 0 while not eq?(x,xp) repeat (x := rst x; xp := rst xp; npp := npp+1) - [true, npp, per] + [true, npp, periode] delay(fs:()->%) == [NonNullStream, fs pretend %] -- cgit v1.2.3