caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: CREGUT Pierre FTRD/DTL/LAN <pierre.cregut@rd.francetelecom.com>
To: OCAML <caml-list@inria.fr>
Subject: Re: [Caml-list] "polymorphic" exceptions?
Date: Thu, 19 Jul 2001 08:51:01 +0200	[thread overview]
Message-ID: <20010719085101.A17284@lat4149.rd.francetelecom.fr> (raw)
In-Reply-To: <20010625152919.A18486@miss.wu-wien.ac.at>; from mottl@miss.wu-wien.ac.at on lun, jun 25, 2001 at 03:29:20 +0200

Ok, i didn't reply to your first post immediately, so here is my 5 cents 
answer .

Pierre

Quoting Markus Mottl (mottl@miss.wu-wien.ac.at):
> 
> even though the type variable is bound in "el : 'el". This seems perfectly
> safe to me, because only the body of "add" can see the module and knows
> what 'el is when catching the exception. Code outside cannot access the
> module and therefore cannot catch the exception, which could be unsound if
> 'el is not known at this point.
I don't understand what you mean by "cannot access". add can give back
functions and you can also register functions with callbacks via global
references directly in the code of the module even if they were restricted
to the unit -> unit type or (unit -> unit) -> unit.

Those functions can raise exceptions or catch them (eg. functional catching
the exceptions raised by their function argument and printing it back or
whatever). 
So your exception CAN escape the scope of add and you can mix an
exception created by one call to add with one given type, with a catcher 
created by another call with another type.

exception tags are defined at link time as far as I know.
They are not so dynamic so that you can compile matching.

-- 
Pierre Cregut - pierre.cregut@rd.francetelecom.com - +33 2 96 05 16 28
FTR&D - DTL/MSV - 2 avenue Pierre Marzin - 22307 Lannion Cedex - France
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-07-19 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-25 13:29 Markus Mottl
2001-07-19  6:51 ` CREGUT Pierre FTRD/DTL/LAN [this message]
2001-07-19 11:37   ` Markus Mottl

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=20010719085101.A17284@lat4149.rd.francetelecom.fr \
    --to=pierre.cregut@rd.francetelecom.com \
    --cc=caml-list@inria.fr \
    /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).