English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] GC and file descriptors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-19 (14:27)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] GC and file descriptors
On Wed, 2003-11-19 at 12:33, Martin Berger wrote:

> i dont see a problem here. simply use exception specification
> polymorphism: map has type
>     forall A B E: (A -> B throws E) -> list[A] -> list[B] throws E.

OK, I'll have to think about that, I've not seen it before.

> i do not think that the exception thrown is an implementation
> detail

The problem is that in practice it very often is.

In Felix, for example. I throw

	ClientError of location * string

a lot. The choice is arbitrary: its used for
a type error, a constraint violation,
and even ill formed syntax. I also throw

	ClientError2 of location * location * string

sometimes when I want to indicate two places
in the source (such as when there is a duplicate

I think that because excpetions are basically
a generative kind, they really are an implementation
detail, even if the constraint being violated is not.

To put this another way, exceptions do NOT
reflect the error, they reflect the style
of reporting it.

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners