XC: Chan I/O and multiple variables

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
ahenshaw
Experienced Member
Posts: 96
Joined: Mon Mar 22, 2010 8:55 pm

XC: Chan I/O and multiple variables

Post by ahenshaw »

Could we see multiple-values/multiple variables (as used in XC functions) available for channel I/O? I'd like to be able to do (for example):

Code: Select all

{int, float} some_computation() {
    int x;
    float y;
    ... some code
    return {x, y};
}

int a;
float b;
chan c;
par {
    c <: some_computation();
    c :> {a, b} ;
}
I could do this with a struct, but it seems like this syntax would be preferable, in many cases, and a natural extension to the current language definition.