And again, I had mistyped one thing in initial email: (* ... *) var tmp = (recv_buf_pf | recv_buf) (* var instead of val in both similar lines *) (* ... *)
чт, 9 июл. 2020 г. в 23:47, ice.r...@gmail.com <ice.redm...@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 : &pollfd_t >> _ > , env: !VT > ): void = > (* body goes here *) > > val tmp = (recv_buf_pf | recv_buf) > val () = array_foreach_funenv > <pollfd_t> > {array_v(pollfd_t, fdsl,nfds)} > {VT} > ( fds_pf | fds, nfds, walker, tmp) > val (recv_buf_pf | _) = tmp > > But, as soon as I want to use VT of type > vtypedef VT = (array_v(char?, l, recv_sz) | ptr l, size_t recv_sz) > (* ... *) > val tmp = (recv_buf_pf | recv_buf, recv_sz) > (* .. *) > val (recv_buf_pf | _) = tmp > > I am getting the following error: > error(3): mismatch of sorts: > the needed sort is [S2RTbas(S2RTBASimp(2; viewtype))]; > the actual sort is [S2RTbas(S2RTBASimp(3; viewt0ype))]. > > How can I fix this error? Thanks in andvance > > -- > You received this message because you are subscribed to a topic in the > Google Groups "ats-lang-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ats-lang-users/A60YvQACw4c/unsubscribe. > To unsubscribe from this group and all its topics, 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/6826800e-17e0-4554-8470-3a7e304bc71bn%40googlegroups.com > <https://groups.google.com/d/msgid/ats-lang-users/6826800e-17e0-4554-8470-3a7e304bc71bn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAHjn2KwuVOyQsrmg86QgU2drgmGVJGjUMjKN_mZoa_H4Pd%2BJ%3Dg%40mail.gmail.com.