Path: utzoo!mnetor!uunet!actnyc!jhs From: jhs@actnyc.UUCP (John Spicer) Newsgroups: comp.lang.fortran Subject: Re: Recursion Message-ID: <748@actnyc.UUCP> Date: 25 Mar 88 16:31:44 GMT References: <7975@agate.BERKELEY.EDU> <533@a.UUCP> <534@a.UUCP> Distribution: na Organization: InterACT Corporation, New York Lines: 27 Summary: RECURSIVE keyword is useful It has been pointed out that FORTRAN can support recursion as the language now exists. This is true, as is proven by the number of implementations that support recursion. However, this does not mean that a recursive keyword is not useful. 1. Many FORTRAN compilers allocate variables as if the were SAVED'd to conform to common practice that expects this to be true. A recursive keyword allows a compiler to continue to do this for non-recursive subprograms. 2. Some architechtures do not support recursion well. For example, on the IBM 370 architechture, it is common to have static parameter packs for subroutine calls, and other static structures. On these systems, the static approach is usually more efficient than building the structures dynamically. Non-recursive procedures could continue to use the more efficient system. 3. Many FORTRAN implementations use dope-vectors for adjustable bound arrays. Recursive routines must construct the dope vector dynamically. Non-recursive routines can build most of the dope vectory statically. The recursive keyword is useful because it allows each implementation to make choices based on a given architechtures, and not produce slower code just because a given subprogram may end up being called recursively. John Spicer InterACT Corp. uunet!actnyc!jhs