From 0b76ee25ae6c1e53e6b007f422aac34273828775 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 26 Nov 2014 13:00:46 -0800 Subject: [PATCH] add report-apply --- debug.rkt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debug.rkt b/debug.rkt index d666b15..7974e75 100644 --- a/debug.rkt +++ b/debug.rkt @@ -11,6 +11,20 @@ (displayln (format "~a = ~v" 'name expr) (current-error-port)) expr)])) +(define-syntax-rule (report-apply proc expr) + (begin + (report (apply proc expr)) + expr)) + +#| +(define-syntax (verbalize stx) + (syntax-case stx () + [(_ proc args ...) + (with-syntax ([proc-input (format-id stx "args to ~a" #'proc)]) + #'(begin + (let () (report (list args ...) proc-input) (void)) + (report (proc args ...))))])) +|# (define-syntax (report* stx) (syntax-case stx ()