Skip to content
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

exception printing #2501

Closed
vicuna opened this issue Apr 24, 2004 · 2 comments
Closed

exception printing #2501

vicuna opened this issue Apr 24, 2004 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 24, 2004

Original bug ID: 2501
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hi,

using the latest CVS-release, the following program behaves differently
when interpreted with "ocaml" or when compiled (byte- or native code):


exception E of char
let _ = raise (E 'a')

The interpreter prints:

Exception: E 'a'.

Running the compiled program yields:

Fatal error: exception Foo.E(97)

Regards,
Markus

--
Markus Mottl http://www.oefai.at/~markus markus@oefai.at

@vicuna
Copy link
Author

vicuna commented Apr 27, 2004

Comment author: administrator

Dear Markus,

using the latest CVS-release, the following program behaves differently
when interpreted with "ocaml" or when compiled (byte- or native code):


exception E of char
let _ = raise (E 'a')

The interpreter prints:

Exception: E 'a'.

Running the compiled program yields:

Fatal error: exception Foo.E(97)

This behavior has been there for quite a while. The toplevel has
access to typing information, and therefore can print the exception
value correctly. The "Fatal error" message of the run-time system
has access only to the machine representations of the arguments to the
exceptions, and thus cannot print them accurately, e.g. it can't
distinguish an integer from a character. I know it's a bit
surprising, but sometimes this behavior of the run-time system is more
helpful than not printing exception arguments at all.

Best wishes,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Apr 29, 2004

Comment author: administrator

not a bug DD 2004-04-29

@vicuna vicuna closed this as completed Apr 29, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant