You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Peering a little at what gdext did, we need to add support for virtual functions (like _process) in order to make this worthwhile.
Here are my current thoughts:
One approach which I'm entertaining, at least at first, is to use a separate ppx for virtual functions, something like let%goverride. This has the same drawbacks as the gdext issue above for the first, less-type safe approach. Specifically, there would be no way to ensure that a virtual method defined in OCaml matched the method signature of the method we are meant to be overriding.
Another approach is to, like in gdext above, enumerate each classes virtual methods, and override them specifically. While generating the code that enumerates the virtual methods, it would be (hopefully) pretty easy to grab their intended signatures too, and compare with the signature given to the ppx.
The nice thing here is we can perform all these extra checks in the previous paragraph at a later date and only provide let%goverride for now. I think this incremental approach is the one we will take for now
The text was updated successfully, but these errors were encountered:
Peering a little at what gdext did, we need to add support for virtual functions (like
_process
) in order to make this worthwhile.Here are my current thoughts:
One approach which I'm entertaining, at least at first, is to use a separate ppx for virtual functions, something like
let%goverride
. This has the same drawbacks as thegdext
issue above for the first, less-type safe approach. Specifically, there would be no way to ensure that a virtual method defined in OCaml matched the method signature of the method we are meant to be overriding.Another approach is to, like in
gdext
above, enumerate each classes virtual methods, and override them specifically. While generating the code that enumerates the virtual methods, it would be (hopefully) pretty easy to grab their intended signatures too, and compare with the signature given to the ppx.The nice thing here is we can perform all these extra checks in the previous paragraph at a later date and only provide
let%goverride
for now. I think this incremental approach is the one we will take for nowThe text was updated successfully, but these errors were encountered: