[chuck-users] spork~ () => foo => bar;

federico lopez fede2001 at gmail.com
Fri Oct 9 07:49:09 EDT 2020


Hi,
>From the manual today I learn that functions can be called in a row with:
() => foo => bar;
I would like directly spork functions in a row, is there a way to do
something like:
spork~ () => foo => bar;

I can spork an extra function to make the call

Thanks,

federico



Sample code:
// ====
200::ms => dur beat;
[8, 4] @=> int parts[];
fun void foo()
{
    <<< "playing foo" >>>;
    parts[0] * beat => now;
}
fun void bar()
{
    <<< "playing bar" >>>;
    parts[1] * beat => now;
}

// spork~ () => foo => bar;  // "only function calls can be sporked" error

// extra function to make the call
fun void testPlay()
{
    () => foo => bar;
}
spork~ testPlay();
while(true) 200::ms => now;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20201009/99265b00/attachment.html>


More information about the chuck-users mailing list