Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!pasteur!ames!pacbell!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.misc Subject: Re: Recursion (was: The D Programming Language) Message-ID: <4045@ihlpf.ATT.COM> Date: 18 Mar 88 17:50:19 GMT References: <3980@ihlpf.ATT.COM> <4000013@eecs.nwu.edu> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 22 In article <4000013@eecs.nwu.edu> gore@eecs.nwu.edu (Jacob Gore) writes: ./ comp.lang.misc / nevin1@ihlpf.ATT.COM (00704a-Liber) / Mar 11, 1988 / .. ..[...] NOT ALL FUNCTIONS ARE INLINEABLE!! Any function ..that can be called recursively (see my above definition of recursive) an ..unknown (at compile/link time) number of times cannot be inlined!! . .It can, if it can be converted to iteration, and a stack is maintained for its .scope. (There is no reason to expect local objects and return addresses to be .on the same stack, is there?) For the circumstances where you must keep a stack around for local objects, what efficiency do you get for inlining vs. calling?? It seems to me that all you are doing is replacing a push and a pop with a jump. For this reason, I do not believe that converting to iteration (such as optimizing tail recursive functions) is true inlining. In this case, we are not eliminating the calling mechanism, we are just changing its' name. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_