New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embed the unhandled effect in the exception Unhandled #11185
Comments
@kayceesrk It seems that you like this proposal---I wonder how you feel about it? I am asking now because this cannot be easily changed once OCaml 5.0 is released. I intended to make a PR but was then felt uncomfortable hacking the assembly code across all platforms (specifically, the |
@ocaml/caml-devel this must be decided before 5.0 is released, it will be too late afterwards. Please discuss ASAP. |
I don't know what the deep implications of this design decision might be, but from the end user's point of view, it seems desirable to let the exception An alternative might be to not wrap the unhandled effect in an exception at all: just treat unhandled effects in a primitive way, in the same way unhandled exceptions are treated. But that doesn't seem very appealing: it creates a new kind of unexpected situation and (I imagine?) may lead to code duplication in the runtime system and/or in user code. |
I have made a PR for this: #11419. |
I wonder if it is possible to embed the unhandled effect in the exception
Unhandled
. In terms of the OCaml syntax, it's like this:This would enable a library to register a printer via
Printexc
for its effects, which seems to be useful for debugging (e.g., reminding the user to call somerun
to handle effects).The text was updated successfully, but these errors were encountered: