Skip to content

ocaml error when using 'list_of_string' function #2578

Answered by aseemr
alex4482 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry, this was a bug in the implementation of FStar_List.last. I have now pushed a fix for the same so your code should compile with the F* master branch.

Regarding your other two questions:

  • You can write char constants with '. E.g. let pChar = 'p'
  • For the EOF case, the read_line function in FStar.IO raises an exception EOF when the file ends, so something like this:
let rec read_all (fd:fd_read) : ML unit =
  try
    let s = read_line fd in
    //operate on s
    read_all fd
  with
    | _ -> ()

We will add documentation for it. Hope this helps, thanks for reporting the issue!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nikswamy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants