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.6 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 94833BBAF for ; Mon, 24 Aug 2009 23:58:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocDAD+qkkrQRG8ZgWdsb2JhbACbCAEBFiS7ZoQaBQ X-IronPort-AV: E=Sophos;i="4.44,267,1249250400"; d="scan'208";a="45097078" Received: from mx01.metaweb.com ([208.68.111.25]) by mail4-smtp-sop.national.inria.fr with SMTP; 24 Aug 2009 23:58:14 +0200 Received: from zimbra01.corp.sjc1.metaweb.com (localhost [127.0.0.1]) by mx01.metaweb.com (Spam Firewall) with ESMTP id 4CE62EE52A for ; Mon, 24 Aug 2009 14:57:30 -0700 (PDT) Received: from zimbra01.corp.sjc1.metaweb.com ([172.29.253.13]) by mx01.metaweb.com with ESMTP id YvaqyhIRezIXmVKl for ; Mon, 24 Aug 2009 14:57:30 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra01.corp.sjc1.metaweb.com (Postfix) with ESMTP id 37DCB160C7D0 for ; Mon, 24 Aug 2009 14:57:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra01.corp.sjc1.metaweb.com Received: from zimbra01.corp.sjc1.metaweb.com ([127.0.0.1]) by localhost (zimbra01.corp.sjc1.metaweb.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bP4DCvaO1aop for ; Mon, 24 Aug 2009 14:57:22 -0700 (PDT) Received: from timesink.corp.631h.metaweb.com (timesink.corp.631h.metaweb.com [172.31.20.32]) by zimbra01.corp.sjc1.metaweb.com (Postfix) with ESMTP id 9B817160C081 for ; Mon, 24 Aug 2009 14:57:20 -0700 (PDT) Message-Id: <94AD5806-B6F6-44F7-AA3C-1E63B6C1A722@metaweb.com> From: Warren Harris To: OCaml Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: lazy vs fun Date: Mon, 24 Aug 2009 14:57:19 -0700 X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; ocaml:01 warren:98 warren:98 int:01 int:01 lazy:02 lazy:02 unit:03 let:03 let:03 perhaps:05 rather:08 fun:08 fun:08 evaluation:09 Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? E.g. let x = lazy (3+4) let y = Lazy.force x vs: let x = fun () -> 3+4 let y = x () Perhaps it's just that the type int lazy_t is more informative than unit -> int? Warren