Path: utzoo!mnetor!uunet!husc6!purdue!gatech!emory!platt From: platt@emory.uucp (Dan Platt) Newsgroups: comp.lang.fortran Subject: Re: Recursion Message-ID: <2787@emory.uucp> Date: 26 Mar 88 23:26:34 GMT References: <7975@agate.BERKELEY.EDU> <533@a.UUCP> Reply-To: platt@emory.UUCP (Dan Platt) Distribution: na Organization: Emory University Lines: 17 Following a bunch of stuff about recursion being permitted, we have: In article <533@a.UUCP> jlg@a.UUCP (Jim Giles) writes: >... The question I asked was: "Why is the keyword RECURSIVE >necessary?" Recursion requires variables to be passed by value (in general) rather than by address. If a variable is passed by address, then changing the variable in the subroutine changes the value in the called routine as well. If the value is placed "on the stack" so that the subroutine works with the values in a separate variable space (a new one for each call - and each level of recursion), then changing the variable won't affect its value in the calling routine. In other words, the calling routine will remember the value rather than having it changed with each recursive call.... Dan Platt