By the way, I decided to spend some more time on your issue and got this: ``` #include "share/atspre_define.hats" #include "share/atspre_staload.hats"
#define ATS_DYNLOADFLAG 0 #define FIELD0_SIZE 100 #define FIELD1_SIZE 200 %{^ #define FIELD0_SIZE 100 #define FIELD1_SIZE 200 struct kld_file_stat { int version; char name[FIELD0_SIZE]; int refs; char test[FIELD1_SIZE]; }; %} // end of [%{] typedef kld_file_stat = $extype_struct"struct kld_file_stat" of { version = int , name = @[char][FIELD0_SIZE] , refs = int , test = @[char][FIELD1_SIZE] } fun kern_kldstat {l:addr} (pf: !kld_file_stat @ l | p: ptr l): int = 0 where { val () = !p.name.[0] := 'A' val () = !p.refs := 1 } implement main0 () = { } ``` So, codegen uses kld_file_stat, defined in C. At the same time, it should be noted, that typechecker will not be able to proof, that ATS record represented as the same struct in C, so you can have: ``` { version = int , name = @[char][FIELD0_SIZE] , refs = int , test = @[char][FIELD*0*_SIZE] } ``` without errors from compiler -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KxXcpHFD-pvy5nCgR1zo9EckuCdBO5fudQgV6xzwYkH1w%40mail.gmail.com.