camlp4 :没有可用的报价扩展器
文件 test.ml
仅包含一行:
let foo = <:expr< foo >>
然后,我使用以下命令行将 camlp4 应用于该文件:
camlp4o pa_extend.cmo test.ml
输出为:
File "test.ml", line 1, characters 12-24:
While finding quotation "expr" in a position of "expr":
There is no quotation expander available.
Camlp4: Uncaught exception: Not_found
我希望对文件进行预处理,并适当地扩展引用。我在这里忘记了什么?
The file test.ml
contains only one line:
let foo = <:expr< foo >>
I then apply camlp4 to that file with this command line:
camlp4o pa_extend.cmo test.ml
The output is:
File "test.ml", line 1, characters 12-24:
While finding quotation "expr" in a position of "expr":
There is no quotation expander available.
Camlp4: Uncaught exception: Not_found
I expected the file to be pre-processed and the quotation to be expanded appropriately. What am I forgetting here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当 ocaml >= 3.10 时,您不应使用 pa_extend.cmo,而应使用新的报价模块。它们打包在
camlp4of
可执行文件中,您可以直接使用它来代替camlp4
(或使用camlp4rf
修改语法)。With ocaml >= 3.10, you should not use
pa_extend.cmo
but the new quotations modules. They are packed in thecamlp4of
executable that you can use directly instead ofcamlp4
(orcamlp4rf
for revised syntax).