std._debugManage debug mode, and associated substate hints.
Set or change all the debug substate hints by calling the returned
module functable with no argument to reset to defaults; with true
to set all substate hints into development mode, or false for
production mode.
local _debug = require 'std._debug'(false)
Query substate hints by indexing the returned module functable keys:
local isstrict = _debug.strict
Beware that even though you can change std._debug state at any time, stdlib libraries in particular (but probably other clients too) are configured at load time according to the state at the time they are required - e.g. changing _debug.strict after require 'std' does not affect the strict environment already created for the 'std' module when it was previously loaded.
| __call ([enable]) | Change the all builtin debug hints. |
| __index (name) | Lazy loading of std._debug modules. |
| Substates | Builtin debug substate hints. |
-- Enable all debugging substates local _debug = require 'std._debug'(true)
the submodule that was loaded to satisfy the missing
`name`, otherwise `nil` if nothing was found
local version = require 'std._debug'.version
Use __call metamethod to set all substate hints at once.
Note that none of the debugging features required to implement these
hints are encoded here, this module is merely a central location to
record systemwide hint; other modules you load subsequently may or may
not choose to behave according to their content.
true if runtime argument checking is desired
(default true)
nil if deprecated api warnings are desired;
false if deprecated apis without warnings are desired; true if
removal of deprecated apis is preferred
(optional)
true if strict enforcement of variable declaration
before use is desired
(default true)
require 'std._debug'.argcheck = false