> On Jul 14, 2015, at 10:07 AM, Gustavo Massaccesi <
gus...@oma.org.ar> wrote:
>
> About the OPT. I'll try to rewite my sentence:
>
> If someone decides to adapt the OPT interface to show Racket programs,
> I think that it will be necessary to add the support for tail calls.
> IIRC tail calls are not supported in Python, so I guess that the OPT
> don't show them properly, I guess it keeps all the call stack and when
> the inner function finish the return values travel to the top.
>
> In Racket, the tail calls are more popular, so I think the tail calls
> should be explicitly handled in a "OPT for racket". This may be
> confusing for beginners, so perhaps it can be a configurable option.
>
> The main problem is that iterations are usually implemented as tail
> calls, so the complete call stack can be very big, so it's confusing
> to show them too. (Is it possible to show a few of the first and last
> functions calls and hide the 100-ish repeated middle calls?)
Actually, if I recall the OPT interface correctly, tail calls would happen “automatically.” Specifically, OPT is an off-line display tool. It accepts a list of steps, and displays them. The natural notion of a “stack trace” for the stepper would in fact include only those context frames in non-tail position. In fact, the hard part would probably be in *breaking* tail-calling.