; Values of expressions can be traced by wrapping them along with a ; message, which can be anything, as follows: ; Replace any expression giving rise to the value with: ; ; (show message expression) ; ; The result of this wrapped expression is the same as the value ; of the expression itself there will be a side-effect of displaying ; the value along with the message. ; The display caused by show can be toggled on or off by setting ; the value of variable showbiz to #t or #f. ; ; Once your program is debugged, the wrapped expression can be replaced ; with the original expression. (define showbiz #f) (define (show msg value) (if showbiz (begin (display msg) (display value) (newline) value) value))