lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Jan 19, 2010 at 6:37 AM, David Manura <> wrote:
> I agree with the sentiment: Whenever I add a level parameter to an
> error to setfenv/getfenv, it usually feels fragile or potentially
> wrong.  How does code know the appropriate level parameter of its
> caller?

It's a hard problem to solve generally. In the latest Penlight the
library module environments are registered so that a stack trace can
tell where an error originated from user code, to avoid bothering the
user with too many error details.  This is BTW a very legitimate use
of the debug module.