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

Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc



Andy Wingo scripsit:

> What's wrong with something like this?
> 
>   (define (call-with-input-file filename proc)
>     (let ((port (open-input-file filename)))
>       (with-exception-handler
>         (lambda (x)
>           (close-input-port port)
>           x)
>         (lambda ()
>           (call-with-values (lambda () (proc port))
>             (lambda vals
>               (close-input-port port)
>               (apply values vals)))))))

What happens when the body procedure calls raise-continuable?  When the
exception handler returns, the port has been closed, but the body will
crank on, presumably throwing a non-continuable exception when an attempt
is made to read from the closed port.

-- 
John Cowan  cowan@x   http://ccil.org/~cowan
Consider the matter of Analytic Philosophy.  Dennett and Bennett are well-known.
Dennett rarely or never cites Bennett, so Bennett rarely or never cites Dennett.
There is also one Dummett.  By their works shall ye know them.  However, just as
no trinities have fourth persons (Zeppo Marx notwithstanding), Bummett is hardly
known by his works.  Indeed, Bummett does not exist.  It is part of the function
of this and other e-mail messages, therefore, to do what they can to create him.

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports