[chuck-dev] feature request: ---

Spencer Salazar spencer at ccrma.stanford.edu
Thu Dec 6 19:26:20 EST 2012


I think being able to spork a block of code like this:

spork ~ {
// some code
}

spork ~ {
// some other code
}

would, to a lesser but still helpful degree, alleviate the issues this
proposal is trying to address. It also has the benefit of recombining
existing syntax rather than introducing new syntax.

spencer



On Tue, Dec 4, 2012 at 6:58 AM, Tom Lieber <tom at alltom.com> wrote:

> So you could write this:
>
>   TubeBell b => dac;
>   ---
>   while(40::ms => now) {
>       1 => b.noteOn;
>       1600::ms => now;
>       1 => b.noteOff;
>   }
>   ---
>   do {
>       Std.mtof(Std.rand2(0, 3) + 60) => b.freq;
>   } while(1640::ms => now);
>
> and have it work like this:
>
>   TubeBell b => dac;
>
>   fun void part1() {
>       while(40::ms => now) {
>           1 => b.noteOn;
>           1600::ms => now;
>           1 => b.noteOff;
>       }
>   }
>
>   fun void part2() {
>       do {
>           Std.mtof(Std.rand2(0, 3) + 60) => b.freq;
>       } while(1640::ms => now);
>   }
>
>   spork ~ part1();
>   spork ~ part2();
>   day => now;
>
> --
> Tom Lieber
> http://AllTom.com/
> http://infinite-sketchpad.com/
>
> _______________________________________________
> chuck-dev mailing list
> chuck-dev at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-dev/attachments/20121206/f9c9caca/attachment.html>


More information about the chuck-dev mailing list