ocaml / oloop

Evaluate code through the OCaml toploop for inclusion in educational material.
ISC License
12 stars 5 forks source link

correctly document `Internal_error #17

Closed agarwal closed 9 years ago

agarwal commented 9 years ago

In oloop_outcome.mli, I claim `Internal_error is returned when the OCaml compiler itself raises an exception. I suspect I'm wrong. @Chris00 can you please let me know the correct description.

agarwal commented 9 years ago

I feel the new documentation is avoiding an answer. It doesn't state what Internal_error means, only what it does not mean, i.e. anything that is already covered by another error. I'm fine with that if that's the best we can do. Maybe we should rename this toOther. But I'm okay with `Internal_error, which kind of means "something else happened that we can't say anything specific about".

Chris00 commented 9 years ago

On Tue, 14 Apr 2015 12:38:28 -0700, Ashish Agarwal wrote:

I feel the new documentation is avoiding an answer. It doesn't state what Internal_error means, only what it does not mean, i.e. anything that is already covered by another error. I'm fine with that if that's the best we can do. Maybe we should rename this to Other. But I'm okay with ``Internal_error, which kind of means "something else happened that we can't say anything specific about".

This is just because I don't want to track every exceptions that might be raised at the various stages of the phrase evaluation (although errors of the compilers are registered to print nice messages so it is not that difficult). Besides, it may easily become obsolete with new compiler versions. IMHO, only the compiler errors that the user may want to handle should be listed, it is fine if there is a “grab the others” target.

agarwal commented 9 years ago

Agreed. Let's leave it as is. A catch-all error is perfectly reasonable.

Chris00 commented 9 years ago

We may want to look at the compiler to provide some examples of what the exceptions may be. There is always the risk anyway that an exception carries a non-marshalable value — in which case the toploop will exit (we may want to defend against this).