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.2 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 7FB80BBC4 for ; Wed, 4 Mar 2009 15:12:03 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8BAHgbrknBvsFKmWdsb2JhbACVAQEBAQEBCAsKBxHCRIQIBg X-IronPort-AV: E=Sophos;i="4.38,301,1233529200"; d="scan'208";a="23849475" Received: from dnsp.umh.ac.be (HELO hermes1.umh.ac.be) ([193.190.193.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 04 Mar 2009 15:11:53 +0100 Received: from poincare.swapping.umh.ac.be (poincare.swapping.umh.ac.be [10.102.100.68]) by hermes1.umh.ac.be (8.14.2/8.13.6) with ESMTP id n24EBe23434178; Wed, 4 Mar 2009 15:11:41 +0100 Received: from localhost ([127.0.0.1] ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.69) (envelope-from ) id 1Lerp8-0005iL-Gr; Wed, 04 Mar 2009 15:11:50 +0100 Date: Wed, 04 Mar 2009 15:11:50 +0100 (CET) Message-Id: <20090304.151150.109817942048340471.Christophe.Troestler+ocaml@umons.ac.be> To: sevaAtWork@mail.ru Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] recursive records with weak hashtbl From: Christophe TROESTLER In-Reply-To: <49AE8296.5040009@mail.ru> References: <49AE8296.5040009@mail.ru> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons-Hainaut X-Mailer: Mew version 6.2.51 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 193.190.193.76 X-Spam: no; 0.00; recursive:01 hashtbl:01 christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 hash:01 mutable:01 mutable:01 2009:98 wrote:01 caml-list:01 int:01 int:01 On Wed, 4 Mar 2009 16:31:02 +0300, Vsevolod Fedorov wrote: > > I want to define two records referencing each other. First record (A) > has direct reference to second (B) and second (B) has weak hash table to > list records A, which have reference to it. For example (pseudo code): > > type a > { > id : int ; > mutable field1 : string; > mutable b : B; > } > type b > { > id : int; > mutable field2 : string; > a_list : Weak-Hashtbl(a); (* they referenced me *) > } > > Is it possible at all? type a = { id : int ; mutable field1 : string; mutable b : b; } and b = { id : int; mutable field2 : string; a_list : a Weak.t; (* they referenced me *) };; ChriS