caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe TROESTLER <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
Date: Wed, 04 Mar 2009 15:11:50 +0100 (CET)	[thread overview]
Message-ID: <20090304.151150.109817942048340471.Christophe.Troestler+ocaml@umons.ac.be> (raw)
In-Reply-To: <49AE8296.5040009@mail.ru>

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


      parent reply	other threads:[~2009-03-04 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 13:31 Vsevolod Fedorov
2009-03-04 13:55 ` [Caml-list] " Florent Ouchet
2009-03-04 14:00 ` Virgile Prevosto
2009-03-04 14:00 ` Martin Jambon
2009-03-04 14:11 ` Christophe TROESTLER [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090304.151150.109817942048340471.Christophe.Troestler+ocaml@umons.ac.be \
    --to=christophe.troestler+ocaml@umons.ac.be \
    --cc=caml-list@yquem.inria.fr \
    --cc=sevaAtWork@mail.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).