Js.coerce_opt (Dom_html.document##getElementById id)
I'm new to OCaml, and I'm dealing with Js_of_Ocaml recently. I've seen code as above that includes two pounds after between variable and function. What do they mean?
Js.coerce_opt (Dom_html.document##getElementById id)
I'm new to OCaml, and I'm dealing with Js_of_Ocaml recently. I've seen code as above that includes two pounds after between variable and function. What do they mean?
Ordinary method calls for OCaml objects are written as
obj#meth
.In order to handle
Js
objects,js_of_ocaml
adds a (ppx) syntax extension that usesobj##meth
for invoking methods forJs
objects: https://ocsigen.org/js_of_ocaml/4.0.0/manual/ppx .