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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL 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 795C3BC69 for ; Wed, 28 Mar 2007 08:42:26 +0200 (CEST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2S6gPnN021243 for ; Wed, 28 Mar 2007 08:42:26 +0200 Received: by an-out-0708.google.com with SMTP id c24so2599948ana for ; Tue, 27 Mar 2007 23:42:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=N/gq0ds2k172DUC8P+KH4Wkwg6lZsqFgyEvwalMxiGAqvDZvjhI2w14yjYxR+M+Eb40GSCLaGLdAx2E6JmOC+wGPKqP8UvYr5yXUPLajJJWQHH0jGeoRiAe2xvsU/oTz1/sPykuYJZId08DNTxOL9T6e0tCs8ArnxFDA4FmDqPQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rAL4JyaKTMrYN+8bvMRRlCeoEl+YNcVOAwYJNPBivr0HpVzWvXFEY8AVf6G4CBaLe+ZUgoeZr18llvxoZFqgMhcZ6fkZSdSao1qbyiNNVm5U5oBRBeKSngIJtyCE+i3yhpIRxun8MDNRvZ4l6cUDcng/rL0Jlgr0HKmlkABVE9c= Received: by 10.100.178.7 with SMTP id a7mr58592anf.1175064145162; Tue, 27 Mar 2007 23:42:25 -0700 (PDT) Received: by 10.100.111.13 with HTTP; Tue, 27 Mar 2007 23:42:25 -0700 (PDT) Message-ID: <6f9f8f4a0703272342k6a263784r9a4ecd84d229caa4@mail.gmail.com> Date: Wed, 28 Mar 2007 08:42:25 +0200 From: "Loup Vaillant" To: "Caml mailing list" Subject: Re: [Caml-list] Misunderstandings about the AST In-Reply-To: <6f9f8f4a0703271034m3be7cdc8t43708c8a8a2144ce@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6f9f8f4a0703270644r52490af8ieeedb8f474b95f8e@mail.gmail.com> <6f9f8f4a0703271034m3be7cdc8t43708c8a8a2144ce@mail.gmail.com> X-j-chkmail-Score: MSGID : 460A0E51.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 460A0E51.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; pexp:01 semantically:01 expr:01 expr:01 wrote:01 syntactic:01 constructor:01 caml-list:01 delayed:01 lazy:02 lazy:02 expression:02 expression:02 ast:02 expressions:04 Thank you for your help, I will get back to work. 2007/3/27, Nicolas Pouillard : > On 3/27/07, Loup Vaillant wrote: > > | Pexp_lazy of expression > > Why does this constructor even exist? Are some specific optimizations made? > > Since the evaluation of the expression is delayed it's not a plain function. Actually, I knew that. However, given the following expressions are semantically equivalent: lazy expr;; lazy_from_fun (fun () -> expr);; With "lazy_from_fun" being a plain function, my point is then to know if they are really equivalent (e.g. implementation wise), so I can assume the keyword "lazy" is just syntactic sugar. Loup PS: Nicolas, Sorry for the double post, I messed up the "reply" button.