Should I convert FORTRAN code to C?

Steven Ryan smryan at garth.UUCP
Wed Jul 6 07:56:38 AEST 1988


In Algorithmic Language and Program Development, Bauer and Wossner, they cite
Paterson and Hewitt as proving, essentially, recursion is more powerful than
iteration.

>                                           But I've come across a class of
>problem which can only be generally handled through recursion, I think.  I'd
>be intrigued if someone can come up with a Fortran solution.

I don't want to be in position of proving various examples can be done without
recursion, given the above statement and my own opinions. However this example
is interesting.

A recursive solution assumes the existence of a sufficiently large stack. If
this storage is made available to Fortran program (perhaps as blank common),
a nonrecursive solution would store the loop parameters as array elements:

           while still-something-do
              do-it
              increment-lowest-stack-entry
              while it-overflows
                 reset-it
                 increment-the-next-lowest-stack-entry



More information about the Comp.lang.c mailing list