> The "readme" file of the mini-Prolog interpreter says:
>   Unfortunately, typing a control C to interrupt a query with an infinite loop
>   will exit the Prolog interpreter completely -- sorry, but I don't know a way
>   around this at the moment.
>
> -- A way to implement this, it seems me, is to design Hugs so that a ^C
> generates a Haskell exception; an unhandled exception should then cause an
> interrupt.

The readme you quote is fairly old.

GHC provides exactly the kind of exception handling you want.
Look for mention of asynchronous exceptions in their documentation and/or read the 
paper about asynchronous exceptions on Simon
Peyton Jones home page.

Hugs provides a more limited form of exception handling which lets you catch some 
exceptions but not others.  Unfortunately the
mechanism is not well documented, makes it hard to generate good error messages and 
interacts badly with the recently improved
concurrency implementation in Hugs.  I don't remember if ctrl-C is on the list of 
exceptions it can catch.  Fixing these
deficiencies would be one way of fixing the current problems using the HGL 
(http://haskell.org/graphics) with the recent Hugs
release.  It remains to be seen whether I go down that path.

--
Alastair Reid


_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs

Reply via email to