From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 5707EBB81 for ; Sat, 1 Oct 2005 15:47:51 +0200 (CEST) Received: from first.in-berlin.de (dialin-145-254-065-170.pools.arcor-ip.net [145.254.65.170]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j91DlnrO031363 for ; Sat, 1 Oct 2005 15:47:50 +0200 Received: by first.in-berlin.de (Postfix, from userid 501) id 92D731611FE; Sat, 1 Oct 2005 14:34:25 +0200 (CEST) Date: Sat, 1 Oct 2005 14:34:25 +0200 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: Ant: Re: [Caml-list] Avoiding shared data Message-ID: <20051001123425.GA604@first.in-berlin.de> References: <20050926081727.GA9114@coruscant.stwing.upenn.edu> <20050926210730.55850.qmail@web26803.mail.ukl.yahoo.com> <20050930225737.GA592@first.in-berlin.de> <200509301707.01281.pal_engstad@naughtydog.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200509301707.01281.pal_engstad@naughtydog.com> User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce with ID 433E9385.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 caml-list:01 avoiding:01 bandel:01 recursive:01 recursive:01 ocaml:01 shivers:01 icfp:01 gatech:01 shivers:01 argues:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Fri, Sep 30, 2005 at 05:07:00PM -0700, Pal-Kristian Engstad wrote: > On Friday 30 September 2005 03:57 pm, Oliver Bandel wrote: > > On the other hand: writing mor funtional/recursive code will > > make you more used to to this... > > I've always thought that this was a really bad argument from the ML camp. It is not a bad argument from the ML camp. It's always so, that if you have more practice you will be more used to something and you learn it better. If you don't practise, learning is abandoned. This has nothing to do with programming languages. [...] > The > logic of complicated control-paths is very easily made a zillion times worse > by writing in a tail-recursive style. It is *not* a good programming practice > to make hard-to-read code! Some things are better wriiten down functionally, others are better suited for using impoerative code. Since I get more and more used to using functional and recursive code writing, I can better decide, which way is better. And more and more often I decide to use the recursive style. In OCaml you are not restricted to it, but if you only use one style of programming, and never practise the other programming styles, you can't see, when which programming style/paradigm is better, and the original poster said something about the distinction of tail-rec vs. non tail-rec. (It was not about if that style makes sense or not.) If you practise more of that stuff, and reading some good explanations, then it's obvious, which solution is tail-rec and which is not. > > I encourage people to read the paper by Olin Shivers: "The Anatomy of a Loop - > A story of scope and control", which was presented at ICFP 2005, and can be > found at http://www.cc.gatech.edu/~shivers/papers/loop.pdf. Thanks for the link. > > The author argues that "Writing loops with tail-recursive function calls is > the equivalent of writing them with goto???s." I doubt that the author writes that. You mean for/while instead of goto's as a substitute for recursive functions...?! Ciao, Oliver