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

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

On Fri 24 Feb 2012 07:35, John Cowan <cowan@x> writes:

> 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.

In that case one could inspect the condition to see if it was
continuable -- given conditions, of course.

I don't have any experience with raise-continuable, unfortunately.  Do


Scheme-reports mailing list