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
Resumable exceptions in plain OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-06-16 (21:41)
From: Christophe Raffalli <raffalli@u...>
Subject: Re: [Caml-list] Resumable exceptions in plain OCaml
Christophe Raffalli a écrit :
> Hi,
> may be a little camlp4 would lead to a more natural and readable 
> syntax. The idea is nice but the
>   rraise (Foo i) (fun e -> try raise e with Foo_r1 x -> ...) looks 
> confusing

yet another remark

rraise (Foo i) (function Foo_r1 x -> ... | e -> raise e)

seems shorter, equivalent and more efficient. Am I wrong ?

remark: it seems one very rarely use exceptions as values passed to 
function and matched with normal match ... but this is
completely legal in OCaml !

In fact exceptions in OCaml are one big polymorphic variant type that 
existed before polymorphic variant where introduced ;-)

Christophe Raffalli