Olle Härstedt
Olle Härstedt

Reputation: 4020

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?

Upvotes: 0

Views: 185

Answers (1)

Drup
Drup

Reputation: 3739

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

Upvotes: 1

Related Questions