lua-users home
lua-l archive

5.4.0-alpha: accessing the Lua state in lua_WarnFunction

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


Hello,
in the manual to Lua 5.4.0-alpha-rc2 I noticed that the lua_WarnFunction
that is passed to lua_setwarnf does not get the Lua state as a
parameter. Obviously I could still pass the Lua state myself though the
"ud" parameter.
Is there a reason why the Lua state isn't passed by default? Is it safe
to access the Lua state in the warning function?
I am asking because I have an application where the Lua interpreter can
be used with different user interfaces which are loaded as modules.
Direct text output should not happen, I'd prefer to call a Lua function
for warnings or save the warnings in a Lua table.
Best regards,
David

AltStyle によって変換されたページ (->オリジナル) /