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=AWL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id B8EF3BC6C for ; Fri, 18 Jan 2008 19:02:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAOB4kEfUnw7Xnmdsb2JhbACCNY1fAQEBAQcEBgcKGIEUnEw X-IronPort-AV: E=Sophos;i="4.25,217,1199660400"; d="scan'208";a="6918610" Received: from fhw-relay07.plus.net ([212.159.14.215]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Jan 2008 19:02:56 +0100 Received: from [80.229.56.224] (helo=beast.local) by fhw-relay07.plus.net with esmtp (Exim) id 1JFvYN-0005ii-NQ for caml-list@yquem.inria.fr; Fri, 18 Jan 2008 18:02:55 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Strange performances Date: Fri, 18 Jan 2008 17:56:12 +0000 User-Agent: KMail/1.9.7 References: <1200619933.6383.47.camel@benjamin-laptop> <4790D9FC.5090108@gmail.com> <200801181252.06298.ober.14@osu.edu> In-Reply-To: <200801181252.06298.ober.14@osu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801181756.12233.jon@ffconsultancy.com> X-Spam: no; 0.00; segfault:01 ocaml's:01 ocaml's:01 compiler:01 camlers:01 compiler:01 edgar:98 frog:98 wrote:01 wrote:01 stack:01 caml-list:01 consistent:02 garrigue:03 slightly:03 On Friday 18 January 2008 17:52:06 Kuba Ober wrote: > On Friday 18 January 2008, Edgar Friendly wrote: > > Jacques Garrigue wrote: > > > This is why I sent an erratum. The cause for the segfault was not the > > > array access, but the stack overflow, which occured due to ocaml's > > > peculiar evaluation order. > > > > Is there any case where ocaml's "peculiar evaluation order" results in > > any benefit other than slightly simpler code at the compiler level? I > > understand that people shouldn't depend on evaluation order, but it > > seems that people fall into this trap often. And even extremely > > experienced camlers (if you permit this characterization of you) forget > > this behavior. > > I think that if you apply principle of least astonishment, things should be > evaluated left-to-right. Or at least with a consistent rule. I believe this design was chosen to give the compiler more freedom for optimizing but I agree that left to right is preferable. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e