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?

aneccodeal
  • 8,531
  • 7
  • 45
  • 74

2 Answers2

5

Yes you can with OPA-plugin-builder.

The book is still a work in progress (http://opalang.org/resources/book/index.html) and we will complete the plugin builder part as soon as we can.

But you can guess how it works looking at the Makefile: https://github.com/hhugo/OpaWhiteBoard/blob/master/Makefile

And the cairo.ml plugin: https://github.com/hhugo/OpaWhiteBoard/blob/master/src/opacairo/cairo.ml

The '##' directive are here in particularly to register functions and their types in OPA.

Cédrics
  • 1,974
  • 11
  • 13
1

More precisely, you can get some info and example here : http://opalang.org/resources/book/index.html#hello_binding

Fred
  • 1,092
  • 5
  • 9