From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA19507; Wed, 30 Jul 2003 16:44:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA29026 for ; Wed, 30 Jul 2003 16:44:20 +0200 (MET DST) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6UEiJT18436 for ; Wed, 30 Jul 2003 16:44:19 +0200 (MET DST) Received: from force.stwing.upenn.edu (root@force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.12.9/8.12.9) with ESMTP id h6UEiHgZ002765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Jul 2003 10:44:17 -0400 (EDT) Received: from force.stwing.upenn.edu (wlovas@[127.0.0.1]) by force.stwing.upenn.edu (8.12.9/8.12.9) with ESMTP id h6UEiG4Q016663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Jul 2003 10:44:16 -0400 (EDT) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.12.9/8.12.9/Submit) id h6UEiGqA016662 for caml-list@inria.fr; Wed, 30 Jul 2003 10:44:16 -0400 (EDT) Date: Wed, 30 Jul 2003 10:44:15 -0400 From: William Lovas To: caml-list@inria.fr Subject: Re: [Caml-list] unwind-protect Message-ID: <20030730144415.GA15849@force.stwing.upenn.edu> Mail-Followup-To: caml-list@inria.fr References: <4.3.2.7.2.20030728112622.02f3fef8@localhost> <3F275B5A.3010301@cs.caltech.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F275B5A.3010301@cs.caltech.edu> User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 caml-list:01 hickey:01 re-raising:01 interfere:01 ocamlc:01 re-raised:01 0700,:01 exception:02 stack:02 module:03 wrote:03 behavior:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Jul 29, 2003 at 10:44:58PM -0700, Jason Hickey wrote: > 2. This kind of exception re-raising does not work well with stack > tracing (OCAMLRUNPARAM=b). It would be very nice to add a "finally" > clause that did not interfere with stack tracing, or make it so that > re-raising would preserve the location where the exception was created. It looks to me like re-raising *does* preserve the location where the exception was created. My toy example: --8<-- raise.ml --- let f () = raise Not_found --8<--------------- --8<-- main.ml --- try Raise.f () with e -> raise e --8<-------------- % ocamlc -g -o go raise.ml go.ml % ./go Fatal error: exception Not_found Raised at module Raise, character 26 Called from module Main, character 14 Re-raised at module Main, character 32 I remember one of the developers mentioning this behavior in a discussion a while back. cheers, William ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners