Subj : Re: Are recursive functions ever needed? To : comp.programming From : mwojcik Date : Sun Oct 02 2005 06:19 pm In article <1128170299.381995.203590@z14g2000cwz.googlegroups.com>, "Gene" writes: > You can always translaterecursion to iteration, though you will usually > need a stack to store intermediate results and control information. It's debatable whether transforming recursion to iteration using a manual stack removes the recursion at all. Fortunately, a stack is not required for transforming a recursive function into an iterative one. That can be accomplished using continuation-passing style (CPS), for example. The research on transforming recursive functions into iterative ones is extensive, particularly regarding optimization of the result. Google returns citations to hundreds of papers. -- Michael Wojcik michael.wojcik@microfocus.com When [Columbus] landed on America it was more like an evasion than a discovery. -- Matt Walsh .