OCaml: How to Run a Script with Libraries Included
问题 I'm following the Real World OCaml book to learn OCaml and many of the programs require using the Jane Street Core library. When I use functions from this core library in the toplevel, it works great. There, I just use the following commands to open the Core library. $ #use "topfind";; #thread;; #camlp4o;; #require "core.top";; #require "core.syntax";; open Core.Std;; Then I can run this program line by line in the toplevel and functions like String.split work fine. # let languages = "OCaml