On Thu, Sep 08, 2005 at 04:00:47PM +0000, [EMAIL PROTECTED] wrote:
> $ cat bug.hs
> main = print (let (x,(q,_)) = (1,divMod x x) in q)
> $ runhugs bug.hs
> Illegal instruction (core dumped)
Not entirely innocent: demand for x also causes evaluation of the second
pair, which depends on x: an infinite loop. The correct version is
main = print (let (x,~(q,_)) = (1,divMod x x) in q)
Unfortunately, it's a known bug that some infinite loops cause Hugs to
overrun the C stack, crashing the program. (This is caught under Windows,
but not Unix.)
_______________________________________________
Hugs-Bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/hugs-bugs