Hi all,

Now I'm trying to define mutual struct:

https://github.com/jats-ug/practice-ats/blob/master/struct/main.dats

They are defined following in C:

```
{^
struct foo;
struct bar {
  int a;
  struct foo *p;
};
struct foo {
  int b;
  struct bar *p;
};
%}
```

And they are imported into ATS world with following:

```
absvt@ype struct_foo
vtypedef struct_bar = $extype_struct"struct bar" of {
  a = int,
  p = [l:addr] (struct_foo@l | ptr l)
}
vtypedef struct_foo_impl = $extype_struct"struct foo" of {
  a = int,
  p = [l:addr] (struct_bar@l | ptr l)
}
assume struct_foo = struct_foo_impl
```

But the code using these causes compile error at ATS... What's wrong???

```
implement main0 () = {
  var foo: struct_foo
  var bar: struct_bar
//  val () = foo.p := (view@bar | addr@bar) // Error!
//  val () = bar.p := (view@foo | addr@foo) // Error!
  val () = println! (foo.p)
  val () = println! (bar.p)
//  val () = println! (foo.a) // Error!
//  val () = println! (bar.a) // Error!
}
```

Best regards,
-- 
Kiwamu Okabe at METASEPI DESIGN

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dnghRtmXNgSkvoLON7Ukmh1Wj%2BWH1oV4SWMYfcpX_X8BA%40mail.gmail.com.

Reply via email to