Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ocaml 如何在utop中自动加载cmo_Ocaml - Fatal编程技术网

Ocaml 如何在utop中自动加载cmo

Ocaml 如何在utop中自动加载cmo,ocaml,Ocaml,我已经建立了自己的graph.cmo 我想utop在每次启动时自动加载它 我该怎么做呢?主目录中的.ocamlinit也可以与utop一起使用 nlucaroni@pissarro: ~ $ cat ~/.ocamlinit #load "graph.cmo";; let () = Printf.printf "LOADED!";; nlucaroni@pissarro: ~ $ utop Welcome to utop version 1.11 (using OCaml version 4

我已经建立了自己的
graph.cmo

我想
utop
在每次启动时自动加载它


我该怎么做呢?

主目录中的
.ocamlinit
也可以与
utop
一起使用

nlucaroni@pissarro: ~ $ cat ~/.ocamlinit 
#load "graph.cmo";;
let () = Printf.printf "LOADED!";;

nlucaroni@pissarro: ~ $ utop
Welcome to utop version 1.11 (using OCaml version 4.01.0)!                           
        Camlp4 Parsing version 4.01.0

LOADED!
Type #utop_help for help about using utop.

utop # 

你在里面写
#加载“path/a.cmo”
吗?当然!对不起,我以为你已经这么做了,我早就知道了。