|Tail recursion email@example.com (2000-08-10)|
|Re: Tail recursion firstname.lastname@example.org (Ben Pfaff) (2000-08-13)|
|Re: Tail recursion email@example.com (Daniel C. Wang) (2000-08-14)|
|Re: Tail recursion firstname.lastname@example.org (Toon Moene) (2000-08-14)|
|Re: Tail recursion email@example.com.OZ.AU (2000-08-21)|
|Re: Tail recursion Wilco.Dijkstra@arm.com (Wilco Dijkstra) (2000-08-21)|
|Re: Tail recursion firstname.lastname@example.org (2000-08-21)|
|[6 later articles]|
|From:||email@example.com (John R. Strohm)|
|Date:||10 Aug 2000 00:08:04 -0400|
While kicking around some ugly C code, and clearing the cobwebs by
re-reading the Wizard Book, I stumbled once again across the tail
recursion optimization. (If the recursive call doesn't require any
processing on the result from the recursion, beyond passing it back to
the caller, then the recursion can be turned into a simple branch.)
Scheme compilers are of course required by the IEEE Scheme
specification to do this.
Do any of the commonly-available compilers for "mainstream" languages
do tail recursion optimization? In particular, any C, c++, or Ada
Reason I ask: For some algorithms, the recursive formulation is
actually easier to understand, and MUCH easier to reason with.
Return to the
Search the comp.compilers archives again.