[Scheme-reports] Fwd: Comments on draft 6 about call/cc Alex Shinn (20 Feb 2012 07:37 UTC)
Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Alaric Snell-Pym (20 Feb 2012 10:32 UTC)
Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Jussi Piitulainen (20 Feb 2012 11:15 UTC)
Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Andy Wingo (24 Feb 2012 08:59 UTC)
Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Jussi Piitulainen (22 Feb 2012 11:10 UTC)
Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Alaric Snell-Pym (20 Feb 2012 12:49 UTC)
Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Perry E. Metzger (20 Feb 2012 18:57 UTC)

Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc Andy Wingo 24 Feb 2012 08:58 UTC

On Fri 24 Feb 2012 07:35, John Cowan <cowan@mercury.ccil.org> 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@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports