From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id BF9BEBB81 for ; Mon, 10 Oct 2005 04:22:58 +0200 (CEST) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9A2MvbQ012969 for ; Mon, 10 Oct 2005 04:22:57 +0200 Received: by zproxy.gmail.com with SMTP id z31so92516nzd for ; Sun, 09 Oct 2005 19:22:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=evw+1O0WLzDWpj6Njbo2fp6aln9HriOstGxdkWYRrac+YETDoE2xBrhbUF60VCF7DW4O7G7uwVptheqyV176FWBCRc77d0h6c6oDi3Vr6gjCDntgqRDzpt7PZxSSF+66+skEvFK0m/lzQkP/oTuB/YLBJYtrJvNBJaCPShFYOhw= Received: by 10.36.250.40 with SMTP id x40mr4200829nzh; Sun, 09 Oct 2005 19:22:57 -0700 (PDT) Received: by 10.36.9.4 with HTTP; Sun, 9 Oct 2005 19:22:56 -0700 (PDT) Message-ID: Date: Mon, 10 Oct 2005 11:22:56 +0900 From: Eijiro Sumii Reply-To: sumii@ecei.tohoku.ac.jp To: caml-list@yquem.inria.fr Subject: line number in exception history? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 4349D081.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; eijiro:01 sumii:01 eijiro:01 sumii:01 ocaml:01 bug:01 foo:01 foo:01 ocamlc:01 pervasives:01 blog:98 faq:01 exception:01 exception:01 expression:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Hi, (Sorry if this is a FAQ - I searched a little and couldn't find the answer.= ) A student in Tokyo (_not_ CS major!) reported a "problem" (see below) of ocaml in his blog. I guess it is because the line/character numbers point to the _head_ of the expression that _follows_ where the exception went through. Is this a feature or a bug? Thanks, Eijiro > cat main.ml let () =3D let ret =3D Bar.barFunction (-10) in print_int (ret + 100) > cat foo.ml let fooFunction x =3D if x > 0 then x - 1 else raise (invalid_arg "Give me positive!") > cat bar.ml let barFunction x =3D let y =3D x + 1 in Foo.fooFunction y > cat main.ml let () =3D let ret =3D Bar.barFunction (-10) in print_int (ret + 100) > cat bar.ml let barFunction x =3D let y =3D x + 1 in Foo.fooFunction y > cat foo.ml let fooFunction x =3D if x > 0 then x - 1 else raise (invalid_arg "Give me positive!") > ocamlc -g foo.ml bar.ml main.ml -o test > env OCAMLRUNPARAM=3Db ./test Fatal error: exception Invalid_argument("Give me positive!") Raised at file "pervasives.ml", line 22, character 17 Re-raised at file "foo.ml", line 3, character 46 Called from file "main.ml", line 3, character 2