How to convert a string to integer list in ocaml?
问题 I need to pass two list as command line arguments in ocaml. I used the following code to access it in the program. let list1=Sys.argv.(1);; let list2=Sys.argv.(2);; I need to have the list1 and list2 as list of integers. I am getting the error This expression has type string but an expression was expected of type int list while processing. How can I convert that arguments to a list of integers. The arguments are passed in this format [1;2;3;4] [1;5;6;7] 回答1: Sys.argv.(n) will always be a