debug.scm 635 B

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