From: Luca Pascali <pasckosky2000@yahoo.it>
To: caml-list@inria.fr
Subject: Re: [Caml-list] exception Failure and failwith
Date: Tue, 21 Jun 2005 13:15:46 +0200 [thread overview]
Message-ID: <42B7F6E2.3010508@yahoo.it> (raw)
In-Reply-To: <20050621090740.GA10021@yquem.inria.fr>
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
><http://caml.inria.fr/pub/docs/manual-ocaml/manual033.html#htoc249>
>
>
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
next prev parent reply other threads:[~2005-06-21 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-21 8:34 Luca Pascali
2005-06-21 9:07 ` [Caml-list] " Luc Maranget
2005-06-21 11:15 ` Luca Pascali [this message]
2005-06-21 11:34 ` Luc Maranget
2005-06-21 18:23 ` sejourne_kevin
2005-06-21 18:55 ` William Lovas
2005-06-23 8:04 ` Luca Pascali
2005-06-21 9:30 ` Julien Signoles
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=42B7F6E2.3010508@yahoo.it \
--to=pasckosky2000@yahoo.it \
--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