From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
To: David Teller <David.Teller@univ-orleans.fr>
Cc: "Bünzli Daniel" <daniel.buenzli@erratique.ch>,
"caml-list List" <caml-list@inria.fr>,
Andrej.Bauer@andrej.com
Subject: Re: [Caml-list] [OSR] Exceptionless error management
Date: Thu, 31 Jan 2008 23:01:19 +0100 [thread overview]
Message-ID: <47A2452F.7010109@univ-savoie.fr> (raw)
In-Reply-To: <1201811141.6565.21.camel@Blefuscu>
[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]
>> match try Some (f x) with e -> None with
>> | None -> ..
>> | Some v -> ...
>>
>> Because I need tail recursive functions.
>>
>
>
For tail call and exception, the best is to keep exception and use "let
try" contruct
(a camlp4 extension is available, but the coding is quite simple):
let try x = expr in
normal_case
with
e -> exc_case
is translated to
(try
let x = expr in
fun () -> normal_case
with
e ->
fun () -> exc_case) ()
This way you get tail call in norma_case and exc_case.
Hope this helps,
Christophe
--
Christophe Raffalli
Universite de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex
tel: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
---------------------------------------------
IMPORTANT: this mail is signed using PGP/MIME
At least Enigmail/Mozilla, mutt or evolution
can check this signature. The public key is
stored on www.keyserver.net
---------------------------------------------
[-- Attachment #1.2: Christophe_Raffalli.vcf --]
[-- Type: text/x-vcard, Size: 310 bytes --]
begin:vcard
fn:Christophe Raffalli
n:Raffalli;Christophe
org:LAMA (UMR 5127)
email;internet:christophe.raffalli@univ-savoie.fr
title;quoted-printable:Ma=C3=AEtre de conf=C3=A9rences
tel;work:+33 4 79 75 81 03
note:http://www.lama.univ-savoie.fr/~raffalli
x-mozilla-html:TRUE
version:2.1
end:vcard
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next prev parent reply other threads:[~2008-01-31 22:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-31 8:55 Bünzli Daniel
2008-01-31 9:57 ` [Caml-list] " Till Varoquaux
2008-01-31 11:01 ` Bünzli Daniel
2008-01-31 14:09 ` Andrej Bauer
2008-01-31 14:16 ` Michael Ekstrand
2008-01-31 19:28 ` David Teller
2008-01-31 19:59 ` Michael Ekstrand
2008-01-31 20:05 ` blue storm
2008-01-31 20:03 ` Bünzli Daniel
2008-01-31 20:25 ` David Teller
2008-01-31 20:40 ` David Teller
2008-01-31 21:16 ` Bünzli Daniel
2008-01-31 21:31 ` David Teller
2008-01-31 21:35 ` Jon Harrop
2008-01-31 22:01 ` Christophe Raffalli [this message]
2008-02-01 7:27 ` Michaël Grünewald
2008-02-01 7:47 ` Bünzli Daniel
2008-02-01 10:50 ` Till Varoquaux
2008-02-01 11:31 ` Bünzli Daniel
2008-02-01 15:59 ` Vincent Hanquez
2008-02-01 18:37 ` Bünzli Daniel
2008-02-01 19:43 ` Vincent Hanquez
2008-02-01 16:04 ` David Allsopp
2008-02-01 8:31 ` David Teller
2008-02-01 12:19 ` Yaron Minsky
2008-02-05 10:00 ` David Teller
2008-02-05 10:12 ` Vincent Hanquez
2008-02-05 10:26 ` Bünzli Daniel
2008-02-05 11:06 ` Vincent Hanquez
2008-02-05 13:46 ` Jon Harrop
2008-02-05 11:36 ` Frédéric van der Plancke
2008-02-06 8:45 ` Michaël Grünewald
2008-02-08 13:09 ` Bünzli Daniel
2008-02-05 14:12 ` David Teller
2008-02-11 8:12 ` David Teller
2008-02-11 9:09 ` Bünzli Daniel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47A2452F.7010109@univ-savoie.fr \
--to=christophe.raffalli@univ-savoie.fr \
--cc=Andrej.Bauer@andrej.com \
--cc=David.Teller@univ-orleans.fr \
--cc=caml-list@inria.fr \
--cc=daniel.buenzli@erratique.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox