Please try: val () = foo_ptr.b(9)
The following article is on dot-symbol overloading: http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c260.html On Monday, August 22, 2016 at 6:00:55 AM UTC-4, Kiwamu Okabe wrote: > > Hi Hongwei, > > On Mon, Aug 22, 2016 at 2:28 PM, Hongwei Xi <...> wrote: > > Basically, I think that every struct in C should be first mapped to an > > abstract type. > > I used mutual struct in your style: > > > https://github.com/jats-ug/practice-ats/blob/4af1b892edc700d33312b9289ff7a72861b9a4a1/template_struct/main.dats#L134 > > > However, following code at line 134 causes error... > > ``` > val foo_ptr = takeout_struct_foo_ptr (addr@foo) > val () = foo_ptr.b := 9 // error(3): the type > [S2Eapp(S2Ecst(struct_foo_ptr); S2Evar(foo(8452)))] is expected to be > a tyrec(record). > ``` > > > Also, there is no need to start with C syntax. You can (and probably > should) > > start > > with some syntax of your design and then later find a way to translate C > > syntax into > > your designed syntax. I call this doing-things-in-stages. Trying to do a > > complex thing > > in one step usually ends up with a failure and some frustration. > > Yes. You know that I already made some code for kernel. > > > https://github.com/metasepi/linux-bohai-s2/blob/bohai-s2/metasepi/include/linux/SATS/statfs.sats#L10 > > > Now, I need some semi-automatically-generate tool to try rewriting > such kernel widely. > Such kernel has many many interfaces written by C language!!! > > 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/c08ec658-f97a-4fd9-9723-28b25cd40420%40googlegroups.com.
