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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 5F52BBC37 for ; Sun, 25 Oct 2009 15:11:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAFP540pbeZio/2dsb2JhbACEcr9kj3aBMoI6UwQ X-IronPort-AV: E=Sophos;i="4.44,620,1249250400"; d="scan'208";a="38922386" Received: from quare.fr ([91.121.152.168]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 25 Oct 2009 15:11:52 +0100 Received: from localhost ([127.0.0.1] helo=webmail.quare.fr) by quare.fr with esmtp (Exim 4.69) (envelope-from ) id 1N23p1-0004qp-KF; Sun, 25 Oct 2009 15:11:51 +0100 MIME-Version: 1.0 Date: Sun, 25 Oct 2009 15:11:51 +0100 From: Mathias Kende To: =?UTF-8?Q?St=C3=A9phane_Glondu?= Cc: Subject: Re: [Caml-list] forbidden construct as right hand side of "let rec" In-Reply-To: <4AE0DDF5.8040601@glondu.net> References: <1256250121.4178.37.camel@MATHIAS-ENS> <4AE0DDF5.8040601@glondu.net> Message-ID: X-Sender: mathias@kende.fr User-Agent: RoundCube Webmail/0.2 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" X-Spam: no; 0.00; 0200,:01 mathias:98 mathias:98 2009:98 phane:98 steph:98 wrote:01 rec:01 rec:01 compile:01 caml-list:01 construct:02 let:03 let:03 fri:05 On Fri, 23 Oct 2009 00:34:29 +0200, Stéphane Glondu wrote: > Mathias Kende a écrit : >> let rec g = f g > > What about: > > let rec g x = f g x This will compile, but then I also want to write : let rec h = t (f h) (with t : ('a -> 'b) -> 'a -> 'b) but here, I can't afford to use let rec h x = t (f h) x because t as some side effects and I need it to be evaluated only once. Any idea on how to do that ?