caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Till Varoquaux" <till.varoquaux@gmail.com>
To: "Jonathan Roewen" <jonathan.roewen@gmail.com>
Cc: OCaml <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] A global exception handler...
Date: Thu, 6 Jul 2006 16:48:26 +0200	[thread overview]
Message-ID: <9d3ec8300607060748s18ad08c6v282af9bc795099c8@mail.gmail.com> (raw)
In-Reply-To: <ad8cfe7e0607060739w557b66f7p1f698ed795896eb4@mail.gmail.com>

On 7/6/06, Jonathan Roewen <jonathan.roewen@gmail.com> wrote:
> Hi,
>
> Is it possible to register a global exception handler?
>
> I suppose I could just nest everything inside one giant function if I
> really had to, but I like my toplevel expressions ;-)
>
CamlP4 might come in handy here. I'm guessing you could rewrite your
program so that all your toplevel expressions are in one main ()
function using camlp4. It would have some limitations though: for
instance your exception handler could not use anything defined in main
(unless you where using references). I'm guessing it's not so bad
because whatever happens you cannot have a global exception handler
relying to much on stuff defined in your programm.
> Jonathan


  reply	other threads:[~2006-07-06 14:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 14:39 Jonathan Roewen
2006-07-06 14:48 ` Till Varoquaux [this message]
2006-07-06 15:25   ` Nicolas Pouillard
2006-07-06 15:33     ` Jonathan Roewen
2006-07-06 15:37       ` Nicolas Pouillard
2006-07-06 15:39         ` Jonathan Roewen

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=9d3ec8300607060748s18ad08c6v282af9bc795099c8@mail.gmail.com \
    --to=till.varoquaux@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).