From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "Jonathan Roewen" <jonathan.roewen@gmail.com>
Cc: "Till Varoquaux" <till.varoquaux@gmail.com>,
OCaml <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] A global exception handler...
Date: Thu, 6 Jul 2006 17:37:09 +0200 [thread overview]
Message-ID: <cd67f63a0607060837l478d8a75y8fe132fc143e8731@mail.gmail.com> (raw)
In-Reply-To: <ad8cfe7e0607060833w312b568t3a6abd89ce69153f@mail.gmail.com>
On 7/6/06, Jonathan Roewen <jonathan.roewen@gmail.com> wrote:
> > $ camlp4o global_handler.cmo -printer OCaml global_handler_test.ml
> > try
> > let module Main =
> > struct
> > open Format
> > let f1 x = printf "f1 %d@." x
> > let f2 x = printf "f2 %f@." x
> > let f3 x = printf "f3 %s@." x
> > let _ = f1 1
> > let _ = f2 1.1
> > let _ = f3 "1.1.1"
> > let _ = raise (Failure "test")
> > let global_handler e =
> > (* Note that I need to give the complete name for eprintf since
> > Format is not opened in the new environment of global_handler. *)
> > Format.eprintf "global_handler: %s@." (Printexc.to_string e)
> > end
> > in ()
> > with
> > | e ->
> > (fun e -> Format.eprintf "global_handler: %s@." (Printexc.to_string e)) e
> >
>
> Ah, defining a module inside a function is a neat trick! I didn't
> think of that. Well, I guess it couldn't hurt to do that with all the
> modules which could cause trouble at runtime...
>
> Can I build the new camlp4 with 3.09.2 tools?
>
In fact camlp4 will be part of OCaml 3.10 distribution, so it's better
to try it directly like that, instead of mixing them with 3.09.2.
--
Nicolas Pouillard
next prev parent reply other threads:[~2006-07-06 15:37 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
2006-07-06 15:25 ` Nicolas Pouillard
2006-07-06 15:33 ` Jonathan Roewen
2006-07-06 15:37 ` Nicolas Pouillard [this message]
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=cd67f63a0607060837l478d8a75y8fe132fc143e8731@mail.gmail.com \
--to=nicolas.pouillard@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=jonathan.roewen@gmail.com \
--cc=till.varoquaux@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