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 the Google Groups
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/6826800e-17e0-4554-8470-3a7e304bc71bn%40googlegroups.com.