Subj : Re: Are recursive functions ever needed? To : comp.programming From : Thomas G. Marshall Date : Mon Oct 03 2005 04:50 am Gene coughed up: > This is angels dancing on pins. At a certain level of abstraction, of > course iteration and recursion are the same thing. Yep. At a certain level of abstraction though, everything are quarks.... ;) > The question author was clearly asking By the way, please start quoting to leave at least a /little/ context. > about programming styles in > imperative languages. Recursive in this context means "using self- or > mutually-referential function/procedure calls," and iterative means > "using looping structures." It is certainly always possible to > translate from the former to the latter (and back). > > CPS only hides the mechanism for storing intermediate results. It's > not a priori any more or less "recursive" than a loop and a stack or a > self-referential call. When you compile to code, the RTS will have > either a stack or a heap where closures store the same data as would > have been contained in what you call a "manual stack." Yep. To move a little to the side of what you're saying: I'm not convinced that the term "recursive programming" wasn't really intended to mean that the algorithms recur in some fashion, not that the functions are actually required to /call/ themselves per se. But that's the definition the world seems intent on using, and as such, I'm using it. -- Having a dog that is a purebred does not qualify it for breeding. Dogs need to have several generations of clearances for various illnesses before being bred. If you are breeding dogs without taking care as to the genetic quality of the dog (again, being purebred is *not* enough), you are what is known as a "backyard breeder" and are part of the problem. Most of the congenital problems of present day dogs are traceable directly to backyard breeding. Spay or neuter your pet responsibly, and don't just think that you're somehow the exception and can breed a dog without taking the care described. .