[plt-scheme] match-lambda and source location
At Sat, 03 Jan 2009 00:54:53 +0100, Jakub Piotr Cłapa wrote:
> match-lambda creates a lambda without overriding syntax information.
> This greatly reduces the information content in stack traces.
>
> OTOH overriding the source information for the lambda keyword greatly
> reduces the clarity of the macro code...
I don't understand what you mean. Can you provide an example, describe
how it behaves, and describe how it should behave instead?
> An idea: (WARNING: may be stupid ;)
> Maybe the stack trace should not trace the real stack at all? It could
> get new marks every time the source location barier is crossed (so the
> lambda is reported as a part of match-lambda macro definition source but
> the expression in its body is also mentioned). It could also track tail
> calls in a length limited list (forgetting older "stack" frames).
I may misunderstand this part, too, but I think the first half is what
Errortrace (in the "errortrace" collection) does. It instruments code
to push continuation marks that indicates source locations, and then
the exception handler collects the marks to reconstruct a stack trace.
Errortrace doesn't try to track tail calls beyond the immediate one.
Matthew