Here is Ackerman's function in REBOL

ack: func [m n] [
    either zero? :m [:n + 1]
    [either zero? :n [ack (:m - 1) 1]
       [ack (:m - 1) ack :m (:n - 1)]]]

The Ackermann function is the simplest example of a well-defined
'total function' which is computable but not 'primitive recursive'.
What this means is that there is no iterative version with fixed
bounds of iteration.

I was hoping to try to benchmark it, but it causes a stack
overflow (on A(3,8), which seems to be the standard values), and
because it is not `primitive recursive', I can't figure out how
to turn it into an `imperative' form to avoid stack death.

Do all versions of REBOL use the same stack limit?


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Reply via email to