Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] assert caught by try with _
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: William Lovas <wlovas@s...>
Subject: Re: [Caml-list] unwind-protect
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