caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Simple exception - different behaviour between toplevel and compiled
@ 2015-08-18 22:41 Oliver Bandel
  2015-08-18 23:32 ` David Allsopp
  2015-08-19 11:16 ` Oliver Bandel
  0 siblings, 2 replies; 8+ messages in thread
From: Oliver Bandel @ 2015-08-18 22:41 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Hello,


using the attached files (executing testexc,bash)
I got different results between toplevel and compiled:

=====================================================
Testcase A
exception A of int * int
let _ = raise ( A(3,4) )
Exception: A (3, 4).
Fatal error: exception Exca.A(3, 4)
Fatal error: exception Exca.A(3, 4)
Testcase B
exception B of (int*int)
let _ = raise ( B(3,4) )
Exception: B (3, 4).
Fatal error: exception Excb.B(_)
Fatal error: exception Excb.B(_)
=====================================================

So just adding parantheses in a definition of an exception
yields in these differing results, with not-shown exception-values.

IMHO looks like a case for the bugtracker...

OCaml version is 4.02.1


Ciao,
    Oliver

[-- Attachment #2: exca.ml --]
[-- Type: text/plain, Size: 50 bytes --]

exception A of int * int
let _ = raise ( A(3,4) )

[-- Attachment #3: excb.ml --]
[-- Type: text/plain, Size: 50 bytes --]

exception B of (int*int)
let _ = raise ( B(3,4) )

[-- Attachment #4: testexc.bash --]
[-- Type: text/plain, Size: 203 bytes --]


echo Testcase A
FILE=exca.ml
cat    $FILE
ocaml  $FILE
ocamlc $FILE
./a.out
ocamlopt $FILE
./a.out


echo Testcase B
FILE=excb.ml
cat    $FILE
ocaml  $FILE
ocamlc $FILE
./a.out
ocamlopt $FILE
./a.out



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-19 11:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18 22:41 [Caml-list] Simple exception - different behaviour between toplevel and compiled Oliver Bandel
2015-08-18 23:32 ` David Allsopp
2015-08-19  0:06   ` Arthur Wendling
2015-08-19  5:35     ` Gabriel Scherer
2015-08-19 11:53       ` Oliver Bandel
2015-08-19 11:16 ` Oliver Bandel
2015-08-19 11:22   ` Mr. Herr
2015-08-19 11:26     ` Oliver Bandel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).