chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Add with-error-to-string to ports unit


From: Michael Silver
Subject: [Chicken-hackers] Add with-error-to-string to ports unit
Date: Sun, 19 Jun 2016 22:07:03 -0400

Hello chicken-hackers,

I think it would be nice to add Guile’s with-error-to-string function to CHICKEN’s ports unit:

;; Call procedure THUNK with the current error output-port temporarily
;; bound to a string-output-port and return the accumulated output
;; string.
(define with-error-to-string
  (lambda (thunk)
    (fluid-let ([##sys#standard-error (open-output-string)])
      (thunk)
      (get-output-string ##sys#standard-error))))

This would neatly compliment the port unit’s with-output-to-string. Thoughts?

Thanks,

Michael


Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]