Hello!
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
Vsevolod Fedorov a e'crit :
snip
Is it possible at all?
Yes, you have to use type .. and .. ;; statements
for instance:
type a =
{
id : int ;
mutable field_1 : string;
mutable field_b : b;
}
and b =
{
id : int;
mutable field_2 : string;
field_a_list : a array; (* they referenced me *)
};;
Hello,
Le mer. 04 mars 2009 16:31:02 CET,
Vsevolod Fedorov sevaatw...@mail.ru a écrit :
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
Vsevolod Fedorov wrote:
Hello!
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 :
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 :