*debug*
(keyword)
*debug*
is bound to the keyword :debug
—it provides a global alias to the
dynamic binding indicating whether the integrated debugger is enabled.
repl> (root-env '*debug*)
@{:doc "Enables a built in debugger on errors and other useful features for debugging in a repl."
:dyn true
:source-map ("boot.janet" 1338 1)
:value :debug}
Things I Learned
- Janet has an integrated debugger!
- Starting
janet
with the-d, --debug
flag enables the debugger. Usually Janet exits on error when executing a file, but the-p, --persistent
flag can be used to enter the debugger on error. - When the
:debug
dynamic binding is truthy, you can enter the debugger by raising an error, reaching a breakpoint (ref:debug/break
), callingdebug
, or callingdebugger
with a given fiber (and maybe other ways).