[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [#90 coredump with infinite stream]

From: anonymous
Subject: [Axiom-developer] [#90 coredump with infinite stream]
Date: Wed, 09 Feb 2005 05:25:46 -0600

-From TimDaly Tue Feb 8 05:44:17 -0600 2005
-From: Tim Daly
-Date: Tue, 08 Feb 2005 05:44:17 -0600
-Subject: additional information
-Message-ID: <address@hidden>



This is likely due to stack overflow (previously reported). The construct for 
smallerThan require Axiom to test EVERY element in the stream to see if s < n. 
There is no reason why Axiom should complain. Axiom is not designed to be able 
to figure out a general formula for the nth entry of the output stream for 
smallerThan whose signature is:
smallerThan: (Stream Integer, PositiveInteger)->Stream Integer

To do what you are trying to do, try this:

primes:Stream Integer := generate(nextPrime, 2)
lessThan(stream, n) == filterWhile(s+->s<n, stream)
lessThan(primes, 5)

However, why should this give an error?
entries primes

The expected result would be the first 11 (default stream length) entries.

forwarded from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]