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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B88E1BC0B for ; Tue, 16 Jan 2007 10:00:43 +0100 (CET) Received: from hades.snarc.org (hades.snarc.org [212.85.152.11]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0G90hpA025881 for ; Tue, 16 Jan 2007 10:00:43 +0100 Received: by hades.snarc.org (Postfix, from userid 1000) id 28BC81B481; Tue, 16 Jan 2007 10:00:02 +0100 (CET) Date: Tue, 16 Jan 2007 10:00:02 +0100 To: skaller Cc: Martin Jambon , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml compiler features Message-ID: <20070116090002.GA14494@snarc.org> References: <45A87011.8080203@gmail.com> <200701141823.32855.jon@ffconsultancy.com> <20070114184148.GA26213@snarc.org> <200701142049.57959.jon@ffconsultancy.com> <20070115000544.GA28731@snarc.org> <20070115221717.GA9982@snarc.org> <1168910291.9207.62.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1168910291.9207.62.camel@rosella.wigram> X-Warning: Email may contain unsmilyfied humor and/or satire. User-Agent: Mutt/1.5.13 (2006-08-11) From: tab@snarc.org (Vincent Hanquez) X-Miltered: at concorde with ID 45AC943B.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 ocaml:01 ad-hoc:01 wrote:01 idiom:01 exception:01 caml-list:01 imperative:01 descriptor:02 functional:02 python:02 python:02 executable:03 cleanup:03 On Tue, Jan 16, 2007 at 12:18:11PM +1100, skaller wrote: > I don't miss any of those things .. the point being they're > not so 'common' as you might think. It's totally common to to do some action despite that an exception has been raised or not to cleanup stuff (like file descriptor is the obvious example). At the moment in OCaml you need to multiple layer or try/with to be able to express this. it would be much nicer to allow this construction as a proper idiom, not ad-hoc. > I'm a Python programmer too, and I never use 'finally' .. > I've never found any use for it. You probably don't write/read much python code then. ( I found 2 use of finally in felix's python code ) > Felix has return statement .. but then Felix has *statements*: > executable Ocaml is all expressions, so a return statement would > seem out of place. OCaml is a functional language, however it also contains imperative feature. It doesn't seems so inappropriate to have a return statement, as long it's not abused. -- Vincent Hanquez