From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: [Caml-list] Simple exception - different behaviour between toplevel and compiled
Date: Wed, 19 Aug 2015 00:41:03 +0200 [thread overview]
Message-ID: <20150819004103.Horde.gmnxtcrVOwNtWht0UpT4DzE@webmail.in-berlin.de> (raw)
[-- 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
next reply other threads:[~2015-08-18 22:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-18 22:41 Oliver Bandel [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150819004103.Horde.gmnxtcrVOwNtWht0UpT4DzE@webmail.in-berlin.de \
--to=oliver@first.in-berlin.de \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox