From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA21801; Thu, 19 Jul 2001 12:47:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA21796 for caml-list@pauillac.inria.fr; Thu, 19 Jul 2001 12:47:49 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA18507 for ; Thu, 19 Jul 2001 08:51:41 +0200 (MET DST) Received: from p-mail1.cnet.fr (p-mail1.rd.francetelecom.fr [193.49.124.31]) by concorde.inria.fr (8.11.1/8.10.0) with SMTP id f6J6pe906121 for ; Thu, 19 Jul 2001 08:51:40 +0200 (MET DST) Received: by p-biset.rd.francetelecom.fr with Internet Mail Service (5.5.2653.19) id <3ZABDLC0>; Thu, 19 Jul 2001 08:51:22 +0200 Received: from lat4149.rd.francetelecom.fr ([161.104.14.76]) by l-mhs1.rd.francetelecom.fr with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 30D1774A; Thu, 19 Jul 2001 08:50:15 +0200 Received: by lat4149.rd.francetelecom.fr (Postfix, from userid 1053) id 98EFB42F1; Thu, 19 Jul 2001 08:51:01 +0200 (CEST) Date: Thu, 19 Jul 2001 08:51:01 +0200 From: CREGUT Pierre FTRD/DTL/LAN To: OCAML Subject: Re: [Caml-list] "polymorphic" exceptions? Message-ID: <20010719085101.A17284@lat4149.rd.francetelecom.fr> Mail-Followup-To: CREGUT Pierre FTRD/DTL/LAN , OCAML References: <20010625152919.A18486@miss.wu-wien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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