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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 6E904BCCC for ; Tue, 23 Jan 2007 21:50:52 +0100 (CET) Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0NKop7A000473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 23 Jan 2007 21:50:52 +0100 Received: from mail-in-12-z2.arcor-online.net (mail-in-12-z2.arcor-online.net [151.189.8.29]) by mail-in-11.arcor-online.net (Postfix) with ESMTP id A372711B26; Tue, 23 Jan 2007 21:50:49 +0100 (CET) Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by mail-in-12-z2.arcor-online.net (Postfix) with ESMTP id 92BEF279455; Tue, 23 Jan 2007 21:50:49 +0100 (CET) Received: from moses.efil.de (www.efil.de [213.23.145.142]) by mail-in-03.arcor-online.net (Postfix) with ESMTP id 52D92274861; Tue, 23 Jan 2007 21:50:49 +0100 (CET) Received: by moses.efil.de (Postfix, from userid 1000) id 9DBCBCCCEE; Tue, 23 Jan 2007 21:50:48 +0100 (CET) Date: Tue, 23 Jan 2007 21:43:13 +0100 From: Ingo Bormuth To: caml-list@yquem.inria.fr, mikelin@mit.edu Subject: Re: [Caml-list] ocaml+twt v0.90 Message-ID: <20070123204313.GA4163@efil.de> References: <2a1a1a0c0701161248l5a1d9ad9q739da9c593fc5219@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2a1a1a0c0701161248l5a1d9ad9q739da9c593fc5219@mail.gmail.com> X-Url: http://ibormuth.efil.de/contact User-Agent: Mutt/1.5.13 (2006-08-11) X-Miltered: at discorde with ID 45B6752B.003 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 syntax:01 syntax:01 ocaml:01 semantically:01 semicolon:01 semicolon:01 'let:01 printf:01 printf:01 wrappers:01 implicitly:01 ingo:98 efil:98 0.90:98 On 2007-01-16 15:48, Mike Lin wrote: > This version introduces a major backwards-incompatible change: the > eradication of "in" from let expressions, and the need to indent the let > body (as suggested by the F# lightweight syntax). I downloaded the new version some day ago and immediately fell in love with the compact syntax. In my opinion it feels much more natural. I especially realized that it took me more effort to convert old ocaml+twt code (lots of semantically relevant indentation changes) then it did to convert vanilla ocaml code (essentially s/ *\( in\|;\)$//g plus some optional parentheses removal). > I was hesitant to introduce this feature because it's extra hackish in > implementation (even moreso than the rest of this house of cards). It also > removes some programmer freedom, because you cannot have the let body on the > same line as the let, and you cannot have a statement sequentially following > the let, outside the scope of the binding. A let body beginning in the first line is no problem if you add an additional semicolon: let print x y = print_string x ; (* <-- note the semicolon *) print_string " " print_string y print "Hello" "World" If you need a function in private scope you can easily declare and call it inside a 'let _ =' block: let x = 5 printf "%d\n" x let _ = let y = x+1 printf "%d\n" y printf "no y here" I ran into some minor problems due to ocaml+twt not recognizing the object related syntax. As I personally use it only in rare cases, I ended up with just putting the critical section in one long line. I suggest to implement the '#light' pragma (as in f#) which would allow to swith on and off indentation awareness on the fly. This would also enable me to replace all ocaml compilers by wrappers calling ocaml+twt implicitly. If you want I can prepare a little patch. Thanks for your effort -- keep going on Ingo -- Ingo Bormuth, voicebox & fax: +49-(0)-12125-10226517 public key 86326EC9, http://ibormuth.efil.de/contact