debug.scm 580 B

1234567891011121314151617181920212223
  1. (library (debug)
  2. (export debug-peek)
  3. (import
  4. (except (rnrs base) let-values map error)
  5. (only (guile)
  6. lambda* λ
  7. call-with-output-string
  8. simple-format
  9. current-output-port))
  10. (define debug-peek
  11. (lambda* (sth #:optional (message ""))
  12. (let ([as-string
  13. (call-with-output-string
  14. (λ (port)
  15. (simple-format port "~a" sth)))])
  16. (simple-format (current-output-port)
  17. "~a~a\n"
  18. message
  19. as-string)
  20. sth))))