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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id F29A5BBAF for ; Fri, 23 Oct 2009 19:51:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8BAOOJ4UrRVdPEkGdsb2JhbACRUokcPwEBAQEJCQwHEwOtCIE7hlKIaAEDAwWBfII+BIFdfA X-IronPort-AV: E=Sophos;i="4.44,613,1249250400"; d="scan'208";a="49172394" Received: from mail-yw0-f196.google.com ([209.85.211.196]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Oct 2009 19:51:08 +0200 Received: by ywh34 with SMTP id 34so7623368ywh.1 for ; Fri, 23 Oct 2009 10:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=pOHCreYCBXz33twi0o9Zg9CHeD+G9PMI/wqia0gBhJk=; b=ivDA8EDZ7JEjJxGn21iM1ERI17HWqWfWhNnnDd3AE6RXyLBpWN3lbEFm+lYHP3JbwA V/TDa5T210ZSG7iJRP5eau9KKpolrLpsB7XWjEPvcQ088cSrQEWu6JqAneFL2mt+ZF9+ EFRWpIwbM42TaaIw4pKi4ExwDBXIBLqA2I68I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ttITeVZC5pJin5yXi++pEByONZ9S6587GMJNcrlAZpJnWVTTPSGv1Ktm4TZmnQatRq yZlkTYaD8Nu8DkLZb/EMz1hLKQhbKf9xmsgmkvZAK1I0Kx5Duvz0CCA91ZLi5ZHFO4Tu At73MErK9N0AKzTpviQclcgZrFPrec2Rv937A= MIME-Version: 1.0 Received: by 10.101.21.17 with SMTP id y17mr7258514ani.152.1256320265620; Fri, 23 Oct 2009 10:51:05 -0700 (PDT) In-Reply-To: References: <1256250121.4178.37.camel@MATHIAS-ENS> <4AE0DDF5.8040601@glondu.net> <4a708d20910221610w1c46fbbdk677e8545dcf3cd62@mail.gmail.com> <200910231735142654782@orange.fr> Date: Fri, 23 Oct 2009 19:51:05 +0200 Message-ID: <527cf6bc0910231051v21c5ba9ah46e7e99277176630@mail.gmail.com> Subject: Re: [Caml-list] forbidden construct as right hand side of "let rec" From: blue storm To: Marc de Falco Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; foo:01 foo:01 constructors:01 storm:98 23,:98 2009:98 blogs:98 constants:01 wrote:01 rec:01 rec:01 caml-list:01 right-hand:01 caml:02 caml:02 On Fri, Oct 23, 2009 at 6:14 PM, Marc de Falco wrote: > I don't know the exact rule, but I guess that on the right-hand side of a > let rec defining a ground value named foo you can only write a term which > evaluates to a finite ground term on the currently defined variables + foo. > That is to say something that evaluates to a finite tree of constructors > with > constants or defined variables as leaves. > Maybe someone more knowledgeable could state the exact rule. You can find this in the documentation : http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#toc70 > P.S. : the code using Obj is far from a solution as it modifies the existing > structure > of the list to add cycling and thus, breaks persistency. Well, you can easily copy the list before using Obj, wich preserves persistency. Here is a relevant discussion on the list : http://groups.google.com/group/fa.caml/browse_frm/thread/9aa32076b03dd6ff?pli=1 You can also look at Matias Giovannini's articles on his blogs (wich are recommended reading anyway) : http://alaska-kamtchatka.blogspot.com/2007/11/unsafe-clasp.html http://alaska-kamtchatka.blogspot.com/2007/11/more-elegant-necklace.html