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

173 Views Asked by At

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

1

There are 1 best solutions below

8
Drup On BEST ANSWER

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).