lua-2.3.1: Lua, an embeddable scripting language
Copyright© 2023 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb@hslua.org>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lua.Warn

Description

Simpler interface to the Lua warnings system.

Synopsis

Documentation

hsluaL_setwarnf :: State -> IO () Source #

Sets a warning function. This is a simplified version of lua_setwarnf. The function at the top of the stack is set as the "warning hook", i.e., it is called with the concatenated warning components as the single argument.

The hook function is popped of the stack.

The control messages @on and @off are still supported; as with the default warning function, these commands can switch error reporting to stderr on and off. The given Haskell function will be called in either case, even when the error is not written to stderr.