guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/4] Work towards a more complete implementation of `(rnrs io


From: Ludovic Courtès
Subject: Re: [PATCH 3/4] Work towards a more complete implementation of `(rnrs io ports)'
Date: Tue, 23 Nov 2010 22:13:15 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Hi Andreas,

Looks good, but...

Andreas Rottmann <address@hidden> writes:

>   (call-with-port): Don't use `dynamic-wind', as it is against its
>   specification in R6RS 8.2.6.

[...]

>  (define (call-with-port port proc)
>    "Call @var{proc}, passing it @var{port} and closing @var{port} upon exit of
>  @var{proc}.  Return the return values of @var{proc}."
> -  (dynamic-wind
> -      (lambda ()
> -        #t)
> -      (lambda ()
> -        (proc port))
> -      (lambda ()
> -        (close-port port))))
> +  (call-with-values
> +      (lambda () (proc port))
> +    (lambda vals
> +      (close-port port)
> +      (apply values vals))))

I don’t see what in §8.2.6 would be against ‘dynamic-wind’, and
<http://www.r6rs.org/formal-comments/comment-197.txt> seems to suggest
that it’s OK.

Thanks,
Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]