Kiwamu Okabe
unread,Nov 14, 2015, 7:06:37 AM11/14/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ats-lang-users, ats-lang-users
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