From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 4C5BDBBFB for ; Tue, 21 Jun 2005 13:15:49 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5LBFmW1022737 for ; Tue, 21 Jun 2005 13:15:49 +0200 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 NAA29066 for ; Tue, 21 Jun 2005 13:15:48 +0200 (MET DST) Received: from smtp001.mail.ukl.yahoo.com (smtp001.mail.ukl.yahoo.com [217.12.11.32]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j5LBFmdH020592 for ; Tue, 21 Jun 2005 13:15:48 +0200 Received: (qmail 74300 invoked from network); 21 Jun 2005 11:15:47 -0000 Received: from unknown (HELO ?10.0.0.115?) (pasckosky@213.255.109.130 with plain) by smtp001.mail.ukl.yahoo.com with SMTP; 21 Jun 2005 11:15:47 -0000 Message-ID: <42B7F6E2.3010508@yahoo.it> Date: Tue, 21 Jun 2005 13:15:46 +0200 From: Luca Pascali User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] exception Failure and failwith References: <42B7D0FD.5090305@barettadeit.com> <20050621090740.GA10021@yquem.inria.fr> In-Reply-To: <20050621090740.GA10021@yquem.inria.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 42B7F6E4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42B7F6E4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 failwith:01 maranget:01 compiler:01 'option':01 constructors:01 pervasives:01 ocaml's:01 ocaml's:01 maranget:01 redefines:01 signoles:01 baretta:01 baretta:01 ...:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.5 required=5.0 tests=FROM_ENDS_IN_NUMS autolearn=disabled version=3.0.2 X-Spam-Level: Luc Maranget wrote: > [...] > >Failure is considerd 'internal' (or built-in, or predefined) by the compiler. >The same applies for instance to the 'option' type constructors None >and Some. > >Have a look at the manual > > > I missed it, now I've seen. >You could have expected that 'Failure' is defined in standard library >(eg in module Pervasives) but it is not the case. > >So the answer is: tou can't. >If you shadow OCaml's Failure by your definition, then >you have no longer access to OCaml's Failure. >-- Luc Maranget > > It's what I was afraid of. I got it. Anyway let me make a consideration: It would be nice to have a way (a fake module named Core,for example) to access the core types, exception and definitions in case someone shadows the original one. For example if you open Stream module, it redefines the Failure exception. I will try to avoid this kind of job, but there are already some external modules that do this. Since I received answers only directly, I would like to forward also the answer I got from Julien Signoles, that suggests to define an exception with a new name, equal to the old one exception Prim_Failure = Failure to get rid of any further shadowing. Thanks for the answers. Luca -- ********************************************************************* Luca Pascali luca@barettadeit.com asxcaml-guru@barettadeit.com http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. 02 370 111 55 fax. 02 370 111 54 Our technology: http://www.asxcaml.org/ http://www.freerp.org/ ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it