5

I notice that included in the source of the OpaWhiteBoard example, there is a .ml file here: https://github.com/hhugo/OpaWhiteBoard/blob/master/src/opacairo/cairo.ml

This appears to be OCaml with some directives ("##"). I'm guessing this means it's possible to write extensions to Opa in OCaml, correct?

4

2 回答 2

5

是的,您可以使用 OPA-plugin-builder。

这本书仍在进行中(http://opalang.org/resources/book/index.html),我们将尽快完成插件构建器部分。

但是您可以通过查看 Makefile 猜出它是如何工作的: https ://github.com/hhugo/OpaWhiteBoard/blob/master/Makefile

以及 cairo.ml 插件: https ://github.com/hhugo/OpaWhiteBoard/blob/master/src/opacairo/cairo.ml

'##' 指令特别用于在 OPA 中注册函数及其类型。

于 2011-07-10T20:44:08.923 回答
1

更准确地说,您可以在这里获得一些信息和示例:http: //opalang.org/resources/book/index.html#hello_binding

于 2011-07-11T12:32:42.620 回答