RE: Translated w/ 2.4 CRASH

new topic     » goto parent     » topic index » view thread      » older message » newer message

I recall having tried Ackermann's function in 2.3 without problem.
Regards.
----- Original Message ----- 
From: Andy Serpa <ac at onehorseshy.com>
Subject: Translated w/ 2.4 CRASH


> 
> 
> Ackermann's function crashes when translated!
> 
> 
> function ack(integer m, integer n)
>   if m = 0 then
>     return n+1
>   end if
> 
>   if n = 0 then
>     return ack(m-1,1)
>   end if
>   return ack(m-1,ack(m,n-1))
> end function
> 
> object x
> 
> x = ack(3,8)
> 
> 
> Works fine in the interpreter -- x = 2045.  But translated and it 
> crashes on my system with both Watcom & Borland (2.4 beta translator).  
> It crashes outright -- no ex.err at all.  It doesn't crash with a lower 
> argument, like (3,7).
> 
> I assume something to do with excession recursion?  I am no longer 
> set-up for translating with 2.3 so I don't know if it is a 2.4 thing, 
> but it seems likely.
> 
> By the way, regarding the last problem I reported with a slowdown when 
> recycling a lot of memory -- I discovered a few of my other programs are 
> victim to that as well, especially when using recursive algorithms -- 
> they take longer and longer every time they recurse.  Maybe it is part 
> of the same problem here?
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu