I found this problem in Hugs (on the linux machines):

When running ITERATE on an infinite loop, CTRL + C stops working & you
have to suspend (CTRL + Z), then kill it.

I found this when working on a prime number generator for an exercise at
uni,
where the function being called an infinite number of times by
iterate is itself a perfectly finite function, although I have attached
a simpler example where it is infinite even on one call.

CTRL+C will interrupt the function execution of iterate for about the
first 20 seconds, but if you wait longer the function execution becomes
uninterruptible.

If you run the function without iterate you can terminate it with CTRL+C

even though it's infinite.

The program below should display the symptoms. See the
comments for how to try it out.



Jonathan Rylands.
1st Year Computing at Imperial College, London.

--
Jonathan Rylands
28 - 32 Pembridge Gardens
London W2 4DX

Primary address ----> [EMAIL PROTECTED]


------------------------------------------



itertest :: Int -> [Int]
-- calling this at the prompt with eg. itertest 29
-- is uninterruptible after about 20 seconds
itertest n = iterate looptest n




looptest :: Int -> Int
-- auxiliary function to go into an infinite loop
-- note that this function by itself is perfectly interruptible
looptest x = looptest x


Reply via email to