Hi Hongwei,

On Sat, Aug 27, 2016 at 5:07 PM, Kiwamu Okabe <[email protected]> wrote:
> Now, I'm writing the other solution...

My answer is following:

https://github.com/jats-ug/practice-ats/blob/334c41e981a67153d92fcca25130533c86277619/mutual_struct2/gen.sats
https://github.com/jats-ug/practice-ats/blob/334c41e981a67153d92fcca25130533c86277619/mutual_struct2/main.dats

I like this style, because...

Pros:
* Most pointer access is under at-view.
* Checking NULL pointer is captured by `fun take_struct_foo_p: {l1:agz}`.
* Non-pointer struct member can be easily touched by `->`.
* Easily support double pointer struct member such like `struct foo **p;`.

Cons:
* Writing pointer may cause miss cast such like `pfoo->p := pfoo`.

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/CAEvX6dnwYR8O41BLs_w2jQxN%3D3hD_T_hz%3DEZ%3DusyWj1LNxnJVQ%40mail.gmail.com.

Reply via email to