[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua 5.2 beta & error level
- From: "Ashwin Hirschi" <lua-l@...>
- Date: Fri, 04 Nov 2011 22:00:37 +0100
Looking at the "error" function in Lua 5.2 beta, would it not be more
useful (and friendly) if the traceback that's being generated would also
take the "level" parameter into account?
Why not overwrite the traceback function and strip the message down to
the information you want to reveal? Personally when I ask for a
traceback (which is what error is doing) I want to see the traceback :)
Overriding the traceback may be easy for specific cases, but is less
straight-forward for more generic ones.
If you're fine with the full-blown traceback, Lua already caters to your
need: you can simply call error without any level parameter.
What I'm trying to point out is, when error is passed the extra level
parameter, this happens for a reason. I feel that right now Lua doesn't
honour the spirit of that "level request".
And, at the risk of sounding like a lazy bum who can't even be bothered to
write the code to strip the traceback of pointless lines, Lua 5.2 would be
a better Lua if it did.