12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- (library (debug)
- (export debug-peek)
- (import
- (except (rnrs base)
- let-values
- map
- error
- vector-map)
- (only (guile)
- lambda* λ
- simple-format
- current-output-port
- call-with-output-string)
- (ice-9 pretty-print))
- (define debug-peek
- (lambda* (sth #:optional (message ""))
- (let ([as-string
- (call-with-output-string
- (λ (port)
- (simple-format port "~a" sth)))])
- (simple-format (current-output-port)
- "~a~a\n"
- message
- as-string)
- sth)))
- (define pretty-peek
- (lambda* (thing
- #:optional (port (current-output-port))
- #:key
- (width 80)
- (max-expr-width 80)
- (display? #t)
- (per-line-prefix ""))
- (pretty-print thing
- #:port port
- #:width width
- #:max-expr-width max-expr-width
- #:display? display?
- #:per-line-prefix per-line-prefix)
- thing)))
|