[r6rs-discuss] [Formal] I/O: `call-with-port' and multiple returns

From: Ludovic Courtès <ludovic.courtes>
Date: Fri Feb 23 02:45:20 2007

---
This message is a formal comment which was submitted to formal-comment_at_r6rs.org, following the requirements described at: http://www.r6rs.org/process.html
---
Submitter:      Ludovic Court?s
Email:          ludovic.courtes at laas.fr
Type of Issue:  Defect
Priority:       Major
Component:      I/O
Report:         Revised^5.92 Report on the Algorithmic Language Scheme,
                Standard Libraries
Summary:        `call-with-port' and multiple returns
Section 7.2.6 of the manual does not explicitly mention how
`call-with-port' should behave if PROC returns multiple times.  For
instance, is the following a valid implementation of `call-with-port'?
  (define (call-with-port port proc)
    (dynamic-wind
        (lambda ()
          #t)
        (lambda ()
          (proc port))
        (lambda ()
          (close-port port))))
If it is, I would suggest adding a few words saying that once the
dynamic extent of PROC has been left, PORT is closed even if it is
eventually re-entered.
Thanks,
Ludovic.
Received on Thu Feb 22 2007 - 09:44:58 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC