proper tail calls
peter.hall at memorphic.com
Mon Jan 21 17:26:24 PST 2008
> Tail calls do not have to be self recursive. Only a stack could
> maintain the necessary state...
Ah yes, I see that now. Duh.
> You can easily circumvent an expression being in tail position. For
> example, if EXP is in tail position and you want it not to be, just wrap
> it as:
> let (r = EXP) r
> The program behaves the same, except for the fact that EXP is no longer
> in tail position, so it cannot perform a tail call.
Thanks. That would work. But I can still see the "average" user being
confused when debugging, and not knowing what is going on.
More information about the Es4-discuss