This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: port-char-encoding not working with call-with-output-file


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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]