Version française
Home     About     Download     Resources     Contact us    
Browse thread
exception Failure and failwith
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Luca Pascali <pasckosky2000@y...>
Subject: Re: [Caml-list] exception Failure and failwith
William Lovas wrote:

>On Tue, Jun 21, 2005 at 01:34:40PM +0200, Luc Maranget wrote:
>  
>
> [...]
>
>In fact, one could easily build such a "Core" module as a user, following
>Julien's advice:
>
>  
>
It's what I did. I added to my project a module named core.
This module just has the redefinition of exceptions

>>>exception Prim_Failure = Failure
>>>
>>>to get rid of any further shadowing.
>>>      
>>>
>
>Just take this to the next level with something like:
>
>    module Core =
>      struct
>        exception Failure = Failure
>        type 'a opt = 'a option = None | Some of 'a
>        type 'a option = 'a opt
>        (* ... *)
>      end
>  
>
[...]

>cheers,
>William
>
>  
>
At the moment, in my module, I put only the exceptions, because they are 
the most critical. (It's easier to use a name like Failure for an 
exception or an enumeration, instead of redefining an option type).
Anyway if I will ever need to redefine built-in enumerations too, I will 
use your method.

Bye
LP

-- 
*********************************************************************
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