[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] valid implementation of call-with-input-file?
I wonder if it would be the simplest way to specify that the file is
only and always open in the procedure passed to call-with-input-file.
So an implementation would close the file upon exit (regardless which
one) of the procedure, saving the state so that upon reentrance of the
procedure the file would be reopened and restored to the state on exit
(so seek to the old position etc.) using dynamic-wind.
Is this considered as a sort of hack, or is it not the sane
specification, that the file is open in the procedure, but the
implementation which has to do this hack in order to conform to the
specification because of the design of current operating systems. In
fact, this also applies partially to call/cc, which is in some
implementations also more of a hack involving stack-copying, isn't it?
This is not the fault of the standard, but a problem of the
implementations of other programming languages (having some
restrictions) which force the implementors to do these hacks in order
to interact with these languages.
What do you think?
On Tue, Aug 21, 2012 at 9:15 PM, Arthur A. Gleckler
> I agree that an exceptional exit should close the file.
> Scheme-reports mailing list
Scheme-reports mailing list