[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] StackTracePlus 0.1.0
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Fri, 27 Sep 2013 11:55:46 +0100
2013/9/23 Ignacio Burgueño <firstname.lastname@example.org>:
> I'd like to announce StackTracePlus.
Timing is interesting, I worked on something similar in the last few weeks.
I usually can interpret Lua traces without knowing the locals value,
since I can re-compute their value mentally by following the code
path. There is one exception though, it's when a loop is involved,
since the default traces don't tell at what iteration the error
happened. So my version of the improved debug.traceback adds just
that, iterator values in "for" loops (because "while" and "repeat"
loops are too generic).
I started with a pure Lua implementation there:
Then I back-ported the feature in the Lua sources so that I don't have
to require my module in every place I want improved traces:
It's much more simple (or streamlined depending on the point of view)
than your implementation, but it might be of interest to some. It
introduces lines of the form:
in iteration i=1
in iteration k="a"
in the traces. Note that while it shows the user variable name (i, k),
the value is that of the internal "for" control/index variable (so if
you re-assign to the variable inside the loop, you still see the value
at the beginning of the iteration).