ATS2: need help with arrays

2020-07-07 Thread ice.r...@gmail.com
Hi, I need to provide a type for exteenal call poll() from libc. My initial try was that: ``` typedef pollfd_t = $extype_struct"struct pollfd" of { fd = int , events = sint , revents = sint } fun {n: nat | n > 0}{l: addr} poll ( fds_pf: !array_v( pollfd_t, l, n) >> _ (* proof, that we

bit operations

2020-07-08 Thread ice.r...@gmail.com
Hi, I was not able to find bit operations in ATS, like &, |, <<, >>. Does ATS supports them? -- 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+

arrays and viewtypes

2020-07-09 Thread ice.r...@gmail.com
Hi, I am trying to understand how to use array_foreach_env function to pass to fwork environment of more than 1 variables (of viewt@ype). For example, I can successfully use following: vtypedef VT = (array_v(char?, l, recv_sz | ptr l) fn walker ( array_v(pollfd_t, fdsl, nfds) , x : &pol

datavtypes

2020-07-10 Thread ice.r...@gmail.com
Hi again :) I have function fn recvfrom {l: addr} {n: pos} ( buf_pf: array_v(char?, l, n) | socket_fd: int , buf: ptr l , sz: size_t n , flags: int , src_addr: &sockaddr_in_struct? , addr_sz: &size_t ): [m:int] ssize_t int I want to change it's return type, such that in case

Re: debugging constraint error

2020-09-29 Thread ice.r...@gmail.com
ething like ``` ... [reused_l: bool (l_ucap >= r_len) ] ... ``` ? вторник, 29 сентября 2020 г. в 07:02:02 UTC, ice.r...@gmail.com: > Hi, > I am starting to think, that my code's goal is to explore corner cases of > type checker :) > > This time, I have this error: > `