add naming option to `report`
parent
ea446cfcf5
commit
f7a646c6de
@ -1,8 +1,12 @@
|
||||
#lang racket/base
|
||||
(require (for-syntax racket/base racket/syntax))
|
||||
|
||||
(provide report)
|
||||
|
||||
(define-syntax-rule (report expr)
|
||||
(begin
|
||||
(displayln (format "~a = ~v" 'expr expr) (current-error-port))
|
||||
expr))
|
||||
(define-syntax (report stx)
|
||||
(syntax-case stx ()
|
||||
[(_ expr) #'(report expr expr)]
|
||||
[(_ expr name)
|
||||
#'(begin
|
||||
(displayln (format "~a = ~v" 'name expr) (current-error-port))
|
||||
expr)]))
|
Loading…
Reference in New Issue