[taos-glug] Re: stack frames
- From: Jonathan Bartlett <johnnyb@xxxxxxxxxx>
- To: taos-glug@xxxxxxxxxxxxx
- Date: Wed, 16 Jul 2003 09:42:53 -0700 (PDT)
> [As an
> aside, it would be interesting to see if GCC can do the optimization,
> especially given RMS' interest in Lisp...]
My understanding is that GCC can do the optimization, it is just not as
good at detecting it as SChemish languages.
> I once observed a C course where tail recursion was presented before
> while loops and while loops were explained in terms of tail recursion.
> The instructor strongly believed that tail recursion was more natural
> than loops. Personally, it is for some things, but not always. In my
> mind computing factorials is the classic example of when tail recursion
> is appropriate.
Using recursion over iteration (and thus doing pure functional programming
with no assignments) always has the advantage that it's easier to prove
correctness on using induction. See
http://www.eskimo.com/~johnnyb/comptuers/Functional_Programming.html for a
little more info on the subject.
Jon
- Follow-Ups:
- [taos-glug] Re: stack frames
- From: John McDermott
- References:
- [taos-glug] Re: stack frames
- From: John McDermott
Other related posts:
- » [taos-glug] stack frames
- » [taos-glug] Re: stack frames
- » [taos-glug] Re: stack frames
- » [taos-glug] Re: stack frames
- » [taos-glug] Re: stack frames
- » [taos-glug] Re: stack frames
- [taos-glug] Re: stack frames
- From: John McDermott
- [taos-glug] Re: stack frames
- From: John McDermott