gpt4 book ai didi

ocaml - 为什么 ocamldoc 在未绑定(bind)的模块上失败?

转载 作者:行者123 更新时间:2023-12-04 18:48:19 25 4
gpt4 key购买 nike

这是一个示例界面test.mli , 用 ocamldoc 风格的评论评论:

(** ocamldoc module comment *)
open MissingModule;;
(** ocamldoc function comment *)
val test : unit;;

如果我运行命令 ocamldoc test.mli ,我收到以下错误:
File "test.mli", line 2, characters 0-9:
Error: Unbound module MissingModule
1 error(s) encountered

为什么文档生成器应该关心未绑定(bind)的模块?

最佳答案

那是因为 ocamldoc完全限定类型名称。文件:

open MissingModule

val f: foo -> unit

被翻译成
val f: MissingModule.foo -> unit

MissingModule.foo成为对 foo 定义的很好的交叉引用在 MissingModule (如果 missingModule.mli 作为 ocamldoc 的参数给出)。

为了完成答案,为了完全限定类型标识,您需要键入您正在处理的文件。所以 ocamldoc需要能够访问对应的 .cmi文件。

关于ocaml - 为什么 ocamldoc 在未绑定(bind)的模块上失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10217840/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com