[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proper tail recusion for `or'




John Clements <clements@cs.rice.edu> writes:

> If I understand you correctly, you're surprised by the fact that, say,
> (or #f M) reduces to (or M), rather than directly to M.  This is
> because the beginner and intermediate languages require that all
> arguments to or be booleans.  If M was tail w.r.t the expression (or
> #f M), this check would not be possible.
> 
> Does this answer your question?

Yes, thank you.

I find that the stepper is very useful to explain what proper tail
recursion is to people that never heard about tail recursion before.
So, it is a pity that the stepper cannot be used to reveal tail
optimization whenever it happens (according to R5RS).  Anyway, I
understand the motivation.

MM