On Tue, Oct 03, 2006 at 01:03:59PM +0200, Tomas Janousek wrote:
> It crashes with
>     let test x = test x + 1 in test 1
> but does not with
>     let test x = 1 + test x in test 1
> 
> The same applies for factorial calculation like:
> crash: let fac x = fac (x - 1) * x in fac (-1)
> stack overflow: let fac x = x * fac (x - 1) in fac (-1)

It's a documented bug ("Other bugs in Hugs" in the User's Guide): the
former versions overflow the C stack (SEGV), while the latter overflow
the Hugs stack (nice error message).

More recent versions of Hugs (March and September 2006, neither packaged
for Debian) are better at avoiding overflowing the C stack (e.g. they say
"Control stack overflow" for all four of these examples).



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to