#include "share/atspre_define.hats"
#include "share/atspre_staload.hats"
%{^
struct foo {
int a;
int *p;
};
struct foo foo_var;
%}
absvt@ype struct_foo
vtypedef struct_foo_impl = $extype_struct"struct foo" of {
a = int,
p = [l:addr] (int@l | ptr l)
}
vtypedef pstruct_foo = [l:addr] (struct_foo@l | ptr(l))
assume struct_foo = struct_foo_impl
macdef takeout_pstruct_foo = $extval(pstruct_foo, "&foo_var")
extern praxi addback_pstruct_foo (pstruct_foo): void
implement main0 () = {
val (pf | p) = takeout_pstruct_foo
// val () = foo.a := 1 // error(3): a non-proof component is replaced of the type[S2Ecst(int)].
val () = println! !p.a
// val () = println! foo.p // error(3): the symbol [print] cannot be resolved as no match is found.
prval () = addback_pstruct_foo @(pf | p)
}
--
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 ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
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/CAEvX6d%3DtzQTALLbZkLisbBOfR-VqD%3DTQS4BXBGYj6WKnbcGPyA%40mail.gmail.com.
--
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 ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
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/CAEvX6d%3Dw8Vfi4z7KOUTdUBpZi3kRm-ab0gq0c7NCvPS_mHR6pw%40mail.gmail.com.
--
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 ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
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/CAEvX6dnRibuCXTDgv9gkLoYC92eRz09eoEYi0cu42zBgJWd5mA%40mail.gmail.com.