There seems a misuse of quantifier:
typedef dns_found_callback_t = {l:addr} (!ip_addr_t@l | string, ptr l, ptr)
→ voidOn Saturday, November 14, 2015 at 7:06:37 AM UTC-5, Kiwamu Okabe wrote:
Hi all,
I’m trying to make a function exported from C language.
ATS language side is following:typedef dns_found_callback_t = [l:addr] (ip_addr_t@l | string, ptr l, ptr) -> void extern fun dns_done: dns_found_callback_t = "mac#" implement dns_done (pfat | name, ipaddr, arg) = { val () = dns_done_c (pfat | name, ipaddr, arg) // <= Error occurs at here! }
C language side is following:
void dns_done_c( const char *name, ip_addr_t *ipaddr, void *arg ) { ...
I believe the view will be removed after compile. However the code
can’t be compiled.$ make ATS user/user_main.dats /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): the dynamic expression cannot be assigned the type [S2Eat(S2Etyrec(fltext(ip_addr_t); npf=-1; addr=S2Ecst(uint32)), S2Evar(l$3144(7279)))]. /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): mismatch of sorts in unification: The sort of variable is: S2RTbas(S2RTBASimp(1; t@ype)) The sort of solution is: S2RTbas(S2RTBASimp(7; view)) /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): mismatch of static terms (tyleq): The actual term is: S2EVar(1955) The needed term is: S2Eat(S2Etyrec(fltext(ip_addr_t); npf=-1; addr=S2Ecst(uint32)); S2Evar(l$3144(7279)))
How to use extype on at-view?
Thanks,
Kiwamu Okabe at METASEPI DESIGN