English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
try .. finally ..
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-21 (07:49)
From: Florian Weimer <fw@d...>
Subject: Re: [Caml-list] try .. finally ..
* Alain Frisch:

> Why not:
>
> let unwind_protect f g =
>   match (try f (); None with exn -> Some exn) with
>    | None -> g ()
>    | Some exn -> g (); raise exn
>
> ?

unwind_protect traditionally returns the value of f (), not that of
g ().  I think it is fundamentally non-tail-call.