1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
open Topdirs [@@ocaml.warning "-33"]
open Toploop [@@ocaml.warning "-33"]
let load filename =
let buf = Buffer.create 16 in
let ppf = Format.formatter_of_buffer buf in
match load_file ppf filename with
| true -> ()
| false ->
Format.pp_print_flush ppf ();
failwith
@@ Format.asprintf "Failed to load file `%s': %s" filename (Buffer.contents buf)
;;