How to use extype on at-view?

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

What is the reason for having both: dns_done and dns_done_c?

Are these two functions different?On Sat, Nov 14, 2015 at 8:02 AM, Kiwamu Okabe kiw...@debian.or.jp wrote:

On Sat, Nov 14, 2015 at 9:49 PM, gmhwxi gmh...@gmail.com wrote:

By the way, what is the type of dns_done_c?

extern fun dns_done_c: dns_found_callback_t = “mac#”

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 ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dmo%3DixkOOitbhyQ7kEWZVaG26KmsenyLrTdTTjqqRxumg%40mail.gmail.com
.

By the way, what is the type of dns_done_c?On 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