6 Debugging tools
Utilities for printing the runtime values of variables for debugging purposes, with minimal disruption to code structure.
Boolean parameter for enabling or disabling the printing of debugging information. Defaults to #t.
(current-debug-printer) → (-> string? any void?) |
(current-debug-printer proc) → void? |
proc : (-> string? any void?) |
Parameter controlling the formatting of printed debugging information. Value must be a procedure that takes a message and a value and returns void. The default value prints the message and a colon on one line and pretty-prints the value (slightly indented) on subsequent lines.
Example: | ||||||
| ||||||
| ||||||
5 |
(debug* proc arg ...) → any |
proc : procedure? |
arg : any |
Applies proc to args and prints and returns the return value transparently.
Expands to a define form that prints the value of id as a side effect.
Example: | ||
| ||
|
Like define/debug but expands to a define-values form.
Expands to a let form that prints the value of each id as it is assigned.
Example: | ||||
| ||||
| ||||
3 |
Like let/debug but expands to a let* form.
Like let/debug but expands to a letrec form.
Expands to a let-values form that prints the value of each id as it is assigned.
Example: | ||||
| ||||
| ||||
10 |
Like let-values/debug but expands to a let*-values form.
Like letrec-values/debug but expands to a letrec-values form.
Parameterizes the pretty-print-print-line parameter to a procedure that acts the same as the default, except that every line is prefixed with prefix. prefix must be a string.
Examples: | |||||
| |||||
> (pretty-print square) | |||||
| |||||
| |||||
|
Returns a printable form of the continuation marks of exn that can can be used with pretty-print to produce simple, legible debugging output.