This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: port-char-encoding not working with call-with-output-file
- From: Per Bothner <per at bothner dot com>
- To: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Fri, 21 Nov 2003 12:07:58 -0800
- Subject: Re: port-char-encoding not working with call-with-output-file
- References: <9F8582E37B2EE5498E76392AEDDCD3FE08087AA1@G8PQD.blf01.telekom.de>
Hoehle, Joerg-Cyril wrote:
it looks like port-char-encoding is not fully functional (anymore?), at least
as far as call-with-output-file is concerned.
You are quite right. And looking at the implementation it is clear
it has never checked port-char-encoding.
A possible(?) patch:
(define (call-with-output-file pathname proc)
(let ((port (open-output-file pathname)))
(try-finally
(proc port)
(close-output-port port))))
That looks good. (It also has the advantage of getting rid of files
in kawa/standard.) I checked in this implementation (adding a type
declaration). I also made the equivalent change for
call-with-input-file.
Thanks!
--
--Per Bothner
per@bothner.com http://per.bothner.com/