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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 01471BBCA for ; Tue, 26 Feb 2008 15:34:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGOyw0dA6bL6mGdsb2JhbACQYwEBAQEBBgQECQoYlESHSw X-IronPort-AV: E=Sophos;i="4.25,407,1199660400"; d="scan'208";a="7723146" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 26 Feb 2008 15:34:38 +0100 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1QEYSWe032089 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 26 Feb 2008 15:34:38 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACeyw0dA6bL7mGdsb2JhbACQYwEBAQEBBgQECQoYlESHSw X-IronPort-AV: E=Sophos;i="4.25,407,1199660400"; d="scan'208";a="8607919" Received: from hs-out-0708.google.com ([64.233.178.251]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 Feb 2008 15:34:38 +0100 Received: by hs-out-0708.google.com with SMTP id x43so1653043hsb.9 for ; Tue, 26 Feb 2008 06:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=jNTwDMeXWjLMV9tGnSMsVwWIju1hmK0hz311bLLYQ78=; b=AyaxgLLHbI7duL49qIfP9LvH3N0V+RyuLc4EJbdx4Cy0zw69VgJHlVJw3XoqYy9/Fq935BzrHjxK4AxXes08y4pthHfY6wsNwiA663oNfOGlwhaUQInNlbWqTpnYmv71eWl2flY5KvY9oy1Dk8S/SSv7yfHt//8LaYdHdNHQUoQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pLgVhE1QEQ8gaXWMynRzN1csXnREcstQkS1IUZWKX+/VPEM59r9b9r20F5ey3244LvZBybsCJLPJAfElxywK65WWbk7M2SJZUPIY2uAWqKItKGibTvhUN2S6nic1W2Lt/X7m/yKdC72DMbQW2GferS1j5Ft/8Aqh2TSP07AXnss= Received: by 10.100.251.5 with SMTP id y5mr9715959anh.98.1204036477100; Tue, 26 Feb 2008 06:34:37 -0800 (PST) Received: by 10.100.248.15 with HTTP; Tue, 26 Feb 2008 06:34:37 -0800 (PST) Message-ID: <6f9f8f4a0802260634j133a6b5fl1868c6886f308c1b@mail.gmail.com> Date: Tue, 26 Feb 2008 15:34:37 +0100 From: "Loup Vaillant" To: "Damien Doligez" Subject: Re: [Caml-list] Unexpected restriction in "let rec" expressions Cc: "Caml List" In-Reply-To: <958FA43C-037A-47D3-9352-682443875A69@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6f9f8f4a0802260424o5bce2fd9i89fbfa38bb239a6a@mail.gmail.com> <958FA43C-037A-47D3-9352-682443875A69@inria.fr> X-Miltered: at discorde with ID 47C42374.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; damien:01 damien:01 recursive:01 val:01 fixpoint:01 26,:98 doligez:01 doligez:01 rec:01 rec:01 caml-list:01 unexpected:03 let:03 let:03 expressions:04 2008/2/26, Damien Doligez : > The restriction is documented in section 7.3 of the reference manual, > and it's here to make recursive definitions work correctly under > eager evaluation. OK, I got it. By the way, replacing "couple" by "couple ()" does the trick: # let loop f a = let rec couple () = f (a, snd (couple ())) in fst (couple ());; val loop : ('a * 'b -> 'c * 'b) -> 'a -> 'c = Now, I have yet to figure out the purpose of this so called "fixpoint operator" (and if the above will work at all :-). Thank you all, Loup