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 PAA16725; Wed, 19 Nov 2003 15:27:51 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA16278 for ; Wed, 19 Nov 2003 15:27:50 +0100 (MET) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAJERm117399 for ; Wed, 19 Nov 2003 15:27:48 +0100 (MET) Received: from 203-213-84-84-syd-ts16-2600.tpgi.com.au (203-213-84-84-syd-ts16-2600.tpgi.com.au [203.213.84.84]) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id hAJERaO17671; Thu, 20 Nov 2003 01:27:37 +1100 Subject: Re: [Caml-list] GC and file descriptors From: skaller Reply-To: skaller@ozemail.com.au To: Martin Berger Cc: Caml Mailing List In-Reply-To: <3FBAC862.7010603@dcs.qmul.ac.uk> References: <1069168323.18363.83.camel@pelican> <3FBA4D97.9060309@dcs.qmul.ac.uk> <1069177584.18363.204.camel@pelican> <3FBAC862.7010603@dcs.qmul.ac.uk> Content-Type: text/plain Message-Id: <1069248426.23700.75.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 20 Nov 2003 00:27:06 +1100 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 forall:01 generative:01 formed:98 descriptors:01 syntax:02 exception:02 exception:02 arbitrary:02 string:03 string:03 wrote:03 violation:96 exceptions:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 definition). 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