Ocaml 在utop中使用完全限定名
我想在包含Ocaml 在utop中使用完全限定名,ocaml,utop,Ocaml,Utop,我想在包含a.ml(它有something的定义)的目录中启动utop,并能够在utop中输入a.something。我知道我可以使用“a.ml”,但这会污染全局名称空间。如何使完全限定名A.something在utop中工作?根据\help: #mod_use <str> Usage is identical to #use but #mod_use wraps the contents in a module. #mod#u使用 用法与#use相同,但#mod#u use将
a.ml
(它有something
的定义)的目录中启动utop,并能够在utop中输入a.something
。我知道我可以使用“a.ml”,但这会污染全局名称空间。如何使完全限定名A.something
在utop中工作?根据\help
:
#mod_use <str>
Usage is identical to #use but #mod_use wraps the contents in a module.
#mod#u使用
用法与#use相同,但#mod#u use将内容包装在模块中。
所以#mod#u使用“a.ml”
应该可以做到这一点