io-stuff.ss
#lang scheme
(require scheme/port)
(provide with-input-from-string
         with-output-to-string
         with-input-from-file
         with-output-to-file
         with-io-strings)

; with-io-strings : input(string) thunk -> string
(define (with-io-strings input thunk)
  (with-output-to-string
   (lambda ()
     (with-input-from-string input thunk))))