Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-07-30 (14:44)
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<-- ---
let f () = raise Not_found

--8<-- ---
try Raise.f () with e -> raise e

% ocamlc -g -o go
% ./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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: