ocamljs-of-ocaml

How do I cast an OCaml object into a js_of_ocaml object?


Is it possible to cast or coerce an OCaml object into a js_of_ocaml object and back?


Solution

  • OCaml object and JS object do not have much in common. They are represented and executed very differently by js_of_ocaml.

    There is no way to easily translate from one to the other (just like there is no easy way to turn a record into an object, those are two things that do not have much in common).