write.scm 449 B

12345678910111213141516171819202122
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Richard Kelsey
  3. (define (test)
  4. (let* ((b (allocate-memory 16))
  5. (res (read-block (current-input-port)
  6. b
  7. 16
  8. (lambda (okay? eof? got)
  9. (if (or (not okay?)
  10. eof?)
  11. -1
  12. (write-block (current-output-port)
  13. b
  14. got
  15. (lambda (okay? sent)
  16. (if okay? sent -1))))))))
  17. (deallocate-memory b)
  18. res))