I’m looking (back since some time) at “Chapter 13. Introduction to Views
and Viewtypes” and a question I already had in mind came back: is there a
linear file type in the default ATS2 library? I mean a file type you must
close after you’ve opened it.
If I may, I need a bit of a hint or help for a simple start.
If I do this:
staload "libc/SATS/stdio.sats"
val out = fopen_exn(FILE_NAME, file_mode_w)
val x = fflush1(out)
val () = fclose1_exn(out)
I get an error as fflush1 expects a proof argument. I feel to understand
it’s expected to be a proof out is in write‑mode. But neither fopen_exn
nor fopen returns this proof. How to get a proof out was opened with file_mode_w?
I’m looking (back since some time) at “Chapter 13. Introduction to Views
and Viewtypes” and a question I already had in mind came back: is there a
linear file type in the default ATS2 library? I mean a file type you must
close after you’ve opened it.
If I may, I need a bit of a hint or help for a simple start.
If I do this:
staload "libc/SATS/stdio.sats"
val out = fopen_exn(FILE_NAME, file_mode_w)
val x = fflush1(out)
val () = fclose1_exn(out)
I get an error as fflush1 expects a proof argument. I feel to understand
it’s expected to be a proof out is in write‑mode. But neither fopen_exn
nor fopen returns this proof. How to get a proof out was opened with file_mode_w?