Quantcast
Channel: In Cygwin, OCaml outputs CRLF line endings but inputs only LFs leading to End_of_file
Viewing all articles
Browse latest Browse all 5

In Cygwin, OCaml outputs CRLF line endings but inputs only LFs leading to End_of_file

$
0
0

This is interesting and reminds me of a suggestion I made recently, i.e. if we define a let-operator:

let ( let& ) ch fn =
  Fun.protect ~finally:(fun () -> close_in ch) begin fun () ->
    fn ch
  end

Then we can express this as:

let read_all filename =
  let& ic = open_in_bin filename in
  let len = in_channel_length ic in
  really_input_string ic len

Read full topic


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images