From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C2E4ABC69 for ; Fri, 16 Nov 2007 20:50:59 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADeDPUfU4368nmdsb2JhbACBX40uAQEBAQcCCCk X-IronPort-AV: E=Sophos;i="4.21,428,1188770400"; d="scan'208";a="19396646" Received: from moutng.kundenserver.de ([212.227.126.188]) by mail4-smtp-sop.national.inria.fr with ESMTP; 16 Nov 2007 20:50:59 +0100 Received: from gate.lan.gerd-stolpmann.de (dslb-084-059-119-228.pools.arcor-ip.net [84.59.119.228]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1It7D60gVX-0005MG; Fri, 16 Nov 2007 20:50:40 +0100 Received: from flakew.lan.gerd-stolpmann.de (fw.lan.gerd-stolpmann.de [192.168.1.1]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id A0138C097; Fri, 16 Nov 2007 20:50:39 +0100 (CET) Subject: Re: [Caml-list] Compiler feature - useful or not? From: Gerd Stolpmann To: Fernando Alegre Cc: David Allsopp , 'caml-list' In-Reply-To: <20071116193219.GB22392@gato.physics.und.nodak.edu> References: <20071116181024.GA15777@gato.physics.und.nodak.edu> <00a701c82885$726915b0$017ca8c0@countertenor> <20071116193219.GB22392@gato.physics.und.nodak.edu> Content-Type: text/plain Date: Fri, 16 Nov 2007 20:50:38 +0100 Message-Id: <1195242638.29197.164.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX185LjJJo3bMZj0vawm+iGy6nvR5MFays6rqEnB 7O28rGdmQwkdm6IV+GqwwB3fvGqOmvkyoRooaoTV8KBgyORYt/ 9zyM/0TuIVkwQBtcaEaEJ7Q4JBSxaUM X-Spam: no; 0.00; compiler:01 gerd:01 stolpmann:01 ocaml:01 run-time:01 ocaml:01 recursive:01 gerd:01 stolpmann:01 viktoriastr:01 64293:01 darmstadt:01 6151:01 6151:01 sml:01 Am Freitag, den 16.11.2007, 13:32 -0600 schrieb Fernando Alegre: > > > While exceptions are needed for I/O, no core expression should raise an > > > exception. > > > > compare = compare;; > > > > (though cf. SML equality types) > > > > Good code using permission_of_int (as with good code using int_of_string) > > would ensure that the int is valid before ever calling permission_of_int but > > the permission_of_int itself needs to be able to raise the exception to > > fulfil the contract of its type (int -> permission). > > Exactly. And that is the reason why, IMHO, we may never see such an > extension to OCaml language, since it is primarily a research language > for type checking. (And so run-time "usefulness", or hacks, are > secondary to the OCaml team.) Interesting opinion - as far as I can see there are lots of usefulness hacks in OCaml, and this makes OCaml different from SML. Think of the generic comparison function. Or that recursively defined lazy values may raise Lazy.Undefined. Similar for recursive modules. I also don't think OCaml is a research language for type checking, although such research is done. Other aspects of programming are considered as well. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------