home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0963.lha / SIOD / scm / with-input.scm < prev   
Text File  |  1993-08-19  |  427b  |  12 lines

  1. (define (with-output s p)
  2.         (letrec ((o (fluid output-port))
  3.                  (f (open-port s "w" -1))
  4.                  (e (lambda () (close-output-port f)
  5.                                (set! (fluid output-port) o))))
  6.              (set! (fluid output-port) f)
  7.              (call-on-reset e)
  8.              (p)
  9.              (close-output-port f)
  10.              (set! (fluid output-port) o)
  11.              (uncall-on-reset e)))
  12.