English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] forbidden construct as right hand side of "let rec"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-10-23 (17:51)
From: blue storm <bluestorm.dylc@g...>
Subject: Re: [Caml-list] forbidden construct as right hand side of "let rec"
On Fri, Oct 23, 2009 at 6:14 PM, Marc de Falco <marc.defalco@gmail.com> 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 :

> 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 :

You can also look at Matias Giovannini's articles on his blogs (wich
are recommended reading anyway) :