lua-users home
lua-l archive

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


I need to somehow get the currently running chunk's name (at
truntime).I know this can be done via debug.getinfo(1,"n").name but
the manual(and that "debug" part of it) strongly suggest against using
it for non-debug code. I suppose another option is a custom dofile
function which would set a global __chunkname variable or something
like that but I would like to avoid this approach if possible. It
would be much more elegant if I could pass arguments to the
chunk(something which was discussed a while ago) but I can't. So,...
any suggestions?

Dimitris