print-debug
1 Usage
8.12

print-debug🔗ℹ

Print variables and expressions for debugging purposes. Borrowed from Rust https://blog.rust-lang.org/2019/01/17/Rust-1.32.0.html p-dbg accepts only one item, let it be atom, or expression.

syntax

(p-dbg body)

body can be variable or expression. You can insert p-dbg anywhere in the code (OK, almost anywhere) without cluttering code evaluation. p-dbg returns what body should return.

1 Usage🔗ℹ

(require print-debug/print-dbg)
....
(factorial (p-dbg n))
or

(p-dbg (factorial n))

or

(set! some-big-number (p-dbg (factorial n)))

This will print in stderr a file name (with full path), line number, expression and result of expression.

[long-path/factorial.rkt:13] '(factorial n) = 1405006117752879898543142606244511569936384000000000

Try to guess the number n!