Hi Hongwei, On Sat, Aug 20, 2016 at 1:52 PM, gmhwxi <[email protected]> wrote: > You can have at-views inside a struct, but handing such views is quite > involved. > I would not recommend it.
Umm... It's bad news for me... I'm writing a converter that translate C code into ATS. https://github.com/metasepi/c2ats Now this tool translates following C code: ``` struct { void *(*traverse_func)(int a[10][20], void *f(int i)); int a[2][3][4]; int *b; struct t *c; }; ``` into following ATS code: ``` typedef struct_c2ats_anon_7053 = $extype_struct"struct { void * (*traverse_func)(int a[10][20], void * f(int i)); int a[2][3][4]; int * b; struct t * c; }" of { traverse_func = (@[@[int][20]][10], (int) -> ptr) -> ptr, a = @[@[@[int][4]][3]][2], b = cPtr0(int), c = cPtr0(struct_c2ats_t) } ``` However we can't use cPtr0 in struct... What is best way to import struct from 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/CAEvX6dndm8qBfaAVXB2iHw3D%3DuWidVzTFi%2Bu%2B76su-3f%3DQ_ONg%40mail.gmail.com.
