From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1F0617F8F3 for ; Tue, 27 May 2014 11:37:26 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of romain.bardou@inria.fr) identity=pra; client-ip=178.32.98.231; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain.bardou@inria.fr"; x-sender="romain.bardou@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of romain.bardou@inria.fr) identity=mailfrom; client-ip=178.32.98.231; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain.bardou@inria.fr"; x-sender="romain.bardou@inria.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mo3.mail-out.ovh.net) identity=helo; client-ip=178.32.98.231; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain.bardou@inria.fr"; x-sender="postmaster@mo3.mail-out.ovh.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0BANZbhFOyIGLnnGdsb2JhbABZsXWRQIMQAQuBGQ4BAQEBAQgLCQkUKIIlAQEFeBELGAkWDwkDAgECAUUGAQwIAohCAdQ3F45ZLoQSAQOZc4cUj00 X-IPAS-Result: Ao0BANZbhFOyIGLnnGdsb2JhbABZsXWRQIMQAQuBGQ4BAQEBAQgLCQkUKIIlAQEFeBELGAkWDwkDAgECAUUGAQwIAohCAdQ3F45ZLoQSAQOZc4cUj00 X-IronPort-AV: E=Sophos;i="4.98,918,1392159600"; d="scan'208";a="64310491" Received: from 19.mo3.mail-out.ovh.net (HELO mo3.mail-out.ovh.net) ([178.32.98.231]) by mail3-smtp-sop.national.inria.fr with ESMTP; 27 May 2014 11:37:25 +0200 Received: from mail92.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo3.mail-out.ovh.net (Postfix) with SMTP id BE468FFA42B for ; Tue, 27 May 2014 11:37:24 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 27 May 2014 11:37:23 +0200 Received: from unknown (HELO ?10.1.202.10?) (postmaster@doomeer.com@194.254.61.161) by ns0.ovh.net with SMTP; 27 May 2014 11:36:59 +0200 Message-ID: <53845D04.6000802@inria.fr> Date: Tue, 27 May 2014 11:38:12 +0200 From: Romain Bardou User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Goswin von Brederlow , caml-list@inria.fr References: <53835610.9050609@inria.fr> <20140527092824.GB15848@frosties> In-Reply-To: <20140527092824.GB15848@frosties> X-Enigmail-Version: 1.6+git0.20140323 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 6681934472999504415 X-Ovh-Remote: 194.254.61.161 () X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejvddrheelucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejvddrheelucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-Validation-by: romain@bardou.fr Subject: Re: [Caml-list] Uncaught exceptions in function type. On 27/05/2014 11:28, Goswin von Brederlow wrote: > > On Mon, May 26, 2014 at 05:25:21PM +0200, Philippe Veber wrote: >> Hi Romain! >> >> >>> Some issues: >>> >>> - One needs to separate exceptions into two groups, the ones that you >>> are actually interested in typing (their purpose is to kill the program, >>> so to speak) and the ones that you are not (they are actually used for >>> control flow). >>> >> I would not like such a separation, unless the user can decide the kind of >> each exception (did you say burdensome? ;o). This kind of separation is >> pretty much the reason why there are errors and exceptions in Java, IIRC. > > An exception that is used for control flow will be thrown and quickly > caught. It would not appear in a functions signature if the control > flow is done right. But if you made a mistake and didn't catch it then > it should appear in the signature and give you cause to recheck your > code. > > I would say that exceptions used for control flow are exactly the > ones that you want typed. > > On the other hand exceptions that kill the programm, like out of > memory, would be completly useless to type. Basically anything can > throw out of memory and nobody can catch it. It would simply appear in > every single (non trivial) function and annoy the programmer. Right sorry I was apparently not typing what was actually in my head :D -- Romain