在 utop 中使用完全限定的名称

use fully qualified names in utop

我想在包含 a.ml 的目录中启动 utop(其中有 something 的定义)并能够在 utop 中输入 A.something。我知道我可以做到 #use "a.ml",但这会污染全局命名空间。如何使完全限定名称 A.something 在 utop 中工作?

根据#help

#mod_use <str>
  Usage is identical to #use but #mod_use wraps the contents in a module.

所以 #mod_use "a.ml" 应该这样做。