Well, I think that a compiler may be optimize away the inefficiency due to indirectness. If not, you can always do it on your own. For instance, I introduced .f_x in the following code for accessing .f.x directly:
https://github.com/githwxi/ATS-Postiats-test/blob/master/contrib/hwxi/TEST30/struct1.dats >>Sorry for my mis-understanding. But how to use it on pure ATS language? Could you point some code about it? To be honest, I do not really know what you want to do exactly. If you can use a simple example to illustrate it, then I will try to show the example in ATS. On Saturday, September 3, 2016 at 10:50:32 AM UTC-4, Kiwamu Okabe wrote: > > On Sat, Sep 3, 2016 at 10:16 PM, gmhwxi <...> wrote: > > For the field 'f', you can provide a getref function (instead of a get > > function), > > which returns the pointer to the field (instead of the content of the > > field). > > Yes. However, I think it's not direct method. > > On aptr-style: > > 1. Get pointer to field > 2. Access member > > On at-view style: > > 1. Access member directly > > > A record in ATS CAN keep the proof of an at-view inside a record. > However, > > doing so would complicate programming quite a lot; it may not be > suitable > > for translating C code into ATS. > > Sorry for my mis-understanding. But how to use it on pure ATS > language? Could you point some code about it? > > 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/425d2480-3667-4271-a772-8eb106d54ec8%40googlegroups.com.
