0

How can I create an object property of type Js.optdef_prop with the PPX syntax in js_of_ocaml?

I tried something like follow but with no success:

type t = <foo: Js.js_string Js.t Js.optdef_prop> Js.t
...
(object%js
  val foo = Js.Optdef (Js.string "bar")
end :> t)

The documentation only talks about Js.readonly_prop and Js.prop.

Antoine
  • 1,782
  • 1
  • 14
  • 32

1 Answers1

0

I don't remember implementing, and I doubt it was added later.

IIRC, One of the reason was that there was no easy syntax to use, but I could have just used an attribute. Another was that it didn't seem that useful at the time, but I guess I was wrong. :)

Please make a feature request on the bug tracker.

Drup
  • 3,679
  • 13
  • 14