[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
you?

Andy
-- 
http://wingolog.org/

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