Open agarwal opened 9 years ago
One possibility would be to consider that `Internal_error
is actually an error that the user should not handle (at least not locally, he probably wants to propagate it for some time) and thus that it should be converted to Error.t
. If an exception is meant to be handled, it should be added to invalid_phrase
.
I think it's better to leave it explicit.
If an exception is meant to be handled, it should be added to invalid_phrase.
Yes, but how? Isn't that the problem, that we cannot include exceptions within invalid_phrase because they are not sexp-able.
On Tue, 14 Apr 2015 12:46:36 -0700, Ashish Agarwal wrote:
I think it's better to leave it explicit.
| If an exception is meant to be handled, it should be added to invalid_phrase. Yes, but how? Isn't that the problem, that we cannot include exceptions within invalid_phrase because they are not sexp-able.
Like the previous ones: oloop-top transforms the exception into a polymorphic variant.
So we'd still have the catch-all `Internal_error, which we can't make sexp-able? Sure, then we can always add specific additional errors when desired.
If you list every compiler error, you can make it sexp-able. If you miss one, the oloop-top
program will stop (or be taught to ignore/log it). None of this is very satisfactory.
In Oloop, we factor out
eval_error
fromerror
purely becausewith sexp
doesn't work onexn
. Is there really no workaround? How come it is possible to convertexn
to and fromError.t
, and Error.t supports sexp?